- Learn the machine. Build yourself a computer. Understand how the CPU, memory, and IO work. Even if you forget it all tomorrow, you’ll have at least a rough understanding – trust me, it’s important.
- Everything you know is wrong. Well, not really, but you need to act like it is. Always go back and look at your code with a critical eye – as if it was written by someone else, if that helps – and imagine that you just know there’s something wrong with it, something terribly, terribly wrong, and it’s your mission to find it. Your code will be better because of this sort of attitude.
- Communication is key. Coding is basically communicating with a very dumb machine (the computer). You have to give it very, very precise instructions, being very careful to tell it exactly, precisely what you want it to do. The mark of a good programmer is someone who can commune with the computer on an almost instinctual level. But it’s equally important to be able to talk to real, live people in just as effective a manner. So don’t neglect that “speech” class that they make you take in college!
- Everything you’ve done is junk (a corollary to “everything you know is wrong”). Be humble. Learn from your mistakes. Because you will make them.
- Doublethink can be your friend. Being a really god programmer means walking a fine mental line between being totally confident in what you’re doing – you think that Bill Gates will show up at any given moment to kiss the ground you’re walking on, that’s how good you are – and simultaneously thinking of your work as the worst possible junk that looks like it was hammed out by a bunch of monkeys banging randomly on keyboards.
- 99% of the time, it’s been done before. Otherwise known as “be a lazy programmer.” Take advantage of work that’s been done before – unless you really want to learn how it’s done, in which case you should re-write it on your own, get it to work, and then throw it out and use the pre-made code instead. Humility AND experience, all in one deft stroke!
- Be multi-lingual. You don’t need to be able to write an OS from scratch in x86 assembly or anything, but being able to at least read other languages is a great asset – especially since so much of the 99% of code that’s already been written (see #6 above) has probably been written in a different language from the one you’re using right now.
- Always think of yourself as a student. Programming languages grow and there is always something more to learn, so always think of yourself as a student, and never let go of that feeling.
- Know your tools – but don’t be held hostage by them. Experiment with different IDEs. Try a different code editor. Yes, we all love auto-complete and Intellisense, but you should at least not be completely helpless without it.
- Learn and use source control. Hey, you knew I had to squeeze this in here. There’s just no excuse for not using some form of source control, no matter how small your project is – even if it’s just a little side project you’re doing for nobody but yourself. Subversion is free, and so is the great client TortoiseSVN. They’re both available for Windows and Linux, so you have no excuse for not using them.
Well, there you have it. If you’re a new programmer, hopefully these tips will be helpful to you – goodness knows I wish I had known them all when I started out.