The biggest trouble in the world that we don’t think enough. Okay, I hope I’m not right but I really feel so in these days. It comes in my mind after I read this article. I’m pretty sure that I tend to not think enough when I’m coding and when I’m working on a project. Of course I have to think at the beginning of the work (when I have to select the technologies, when I have to design the structure of the program) and I’m thinking very much when I face an interesting problem (which has intriguing mathematical background) or an insidious bug (which needs heroic efforts), but it is not enough.
Why isn’t it enough? Maybe you think that if you have finished the design and if you have found efficient solutions for the hardest parts of the project, then the rest is just boring typing. You shouldn’t be thinking about the rest. You can turn your mind off, you have the newest integrated development environment with intellisense and autocompletition, all you have to do is just use the instructions and structures and patterns that you use every day, you can type without thinking, the program writes itself. From time to time (about after every 20 lines) you make a short pause, you try to compile your project, the compiler find the typos in no time, you fix them, then you make a short test, now the program runs well. When every component of your program is written in that way, then there is the time for last tests, you (or somebody else) find the bugs and you fix them with a lots of thinking.
I think it is a completely wrong approach. This approach guarantees that you never will be a good programmer, your codes will be a mess and you will work very, very slow and inefficient. And the worst of all, you will be very bored and you will hate the coding, you will hate your job. Is it what you want? I’m thinking now and memories trickle back. Once I heard two guys and they talked about programming, one told to the other: “Save your project after every 10 lines and test it immediately!” I thought: “These guys are not bad, I always do the same!” And I knew a girl who wrote a component to a bigger project in 8 hours without a single compile. Sad, but her code was a mess, it was uncompilable and I thought “she is a kind of dumb”. Now I admire her for her intellectual courage and I’m sure she became a very professional coder in the time that had gone by.
Imagine a guy who want to be better runner but he gets into a car after every 10 steps to come to an other guy for advices. What do you think about? He is a madman. Of course he has to analyze yourself if he want to be a better runner, but he has to do it while he’s running. He has to be thinking and he must ask himself: “Is my workout routine good? Do I run too fast, do I run too slow? Do I use my body in the most efficient way? Is my running posture okay?” I’m sure if you want to be a better runner, you must be thinking all the time. And it is also valid for the programming. Don’t try to compile your project after every 10 lines. Try to write a whole class (hundred of lines) without the help of the compiler. Write the necessary unit tests and don’t execute them, just at the end, when you feel that everything is fine. Stay focused, examine and analyze your code continuously. Notice your typos. Ask yourself again and again: is everything fine, do I really understand and do I really enjoy, what I do?
If you can do it, it is excellent, you are a good programmer. And if you can’t manage that and you are not able to write decent classes in that way, do not take it to heart. Take some practice, read great books, go back to college, forget your PC, take a notebook and a pencil and practice your skills. You can do it when you have some time because it is about thinking basically.