Comment on: Forcing women into programming is a fucking mistake
It's been a while so I'm only 90% sure, but I think if the default value of a missing argument to a constructor is not specified it defaults to zero.
Talk about robbing the cradle.
Comment on: Learning to program is getting harder
I agree it's a pain, but it's just the sort of learning you're going to do while learning to program. How does this work? What does this error message mean? How do I use google? Where can I ask my question?
I started in the pre-GUI days, and the initial learning curve was very steep. Fucking vi as an editor... jesus. You'll spend an hour trying to learn how to exit the thing. Not to go too old-man on you here, but that was before the public internet. If you wanted to ask a question, there better be somebody smart sitting next to you.
Comment on: Learning to program is getting harder
If you're a young kid, use Javascript. All you need is a browser, and notepad.
Beyond that, anyone who can't install a program on their own computer is going to have much bigger trouble with I/O streams, variable scope and recursion. You absolutely have to be willing to learn and able to read on a basic technical level or you have no business even starting.
Comment on: Working as a web developer is making me hate programming
Welcome to the dirty secret of the professional programing world. Doing it fast, with half-assed tools and stupid, every-changing constraints is not a thing that gets in the way of the job, it is the job.
Doing it right, the way that you know is best, is a hobby.
If it makes you feel any better, pretty much every job is like this.
Embrace the suck. You got good at doing things right, now get good at doing it fast, with shit tools, and in a way that makes the guy with the cash in his hand happy. Be one of those scrappy dudes that can fix anything with a hairpin and piece of string. That's rewarding in its own way too.
Comment on: Old guys! What's your advice to younger developers?
When I was young I used to solve problems by writing code. When I got older I preferred to solve problems by not writing code. Reuse is your friend. Fully understand the libraries available to you and make the most of them. Understand the real costs of new code - the debugging, the documentation, the maintenance, the potential surprises. Use the tools you already have.
Write code that protects itself. In the C language there is an assert() function that lets you sanity-check things as you go along, and other languages have a similar feature. These checks get compiled out when you hand a flag to the compiler, so they won't cause a performance hit. I used to put millions of them in all my internal interfaces (these are the places you'll catch most of your bugs). Sanity-check the arguments, the pointers, the counters, the terminators on your strings, the link lists. Often you'll make a dumb mistake over in one corner of the code, and then trip an assert somewhere else the first time you try to run it, and the debugger shows you the whole story. It saves a lot of time and grief.
If you are not using an syntax-sensitive editor, you are either already very good at what you do, or foolishly handicapping yourself. Be honest about this.
If you are not using version-control software to keep track of your changes and your build configurations, spank yourself and go to bed without supper. You're very, very bad.
Write code so humans can read it. Optimize only the stuff you have to, which mostly means your architecture and your design. Few modules really need to be optimized, and when they do, you'll know.
Don't get stuck maintaining code in a dying language. Change jobs if you have to, do what it takes to to keep your skills fresh. Nothing is sadder than a middle-aged guy with out-of-date skills looking for his next job.
Now and again, look around the office and ask yourself who you most want to be like in five years. If you can answer that question, do the work to become that guy. If you can't, start looking for your next gig.
The x == z comparison is unnecessary. Also, why are you adding 5 to the existing value of point1, instead of just assigning it directly?
point1 might be already equal to 5 when you enter this condition. Use your debugger to see what's going on, or if your want to do it ghetto style, add a print statement that shows the values of x, y, and z whenever the code block under the if statement is entered.