Becoming a better programmer is not for the faint of heart. It’s easy to succumb to boredom, the sunny outdoors, and women (or men) but if you’re up for the challenge, the real deal, then this is for you. Why are all master programmers pale, pasty, and afraid of women? Because they did not succumb.
Secret to life #1: Java for breakfast, Shell for lunch, Python for dinner
This one is obvious. You must program. Above all else, you need to do this. Whether it be for a class, a side project, or a job, practice really does make perfect. As Malcolm Gladwell makes clear in his book Outliers, it takes roughly 10000 hours to master something. Make it a point to start a side programming project. If you’re not one to come up with ideas then clone someone else’s idea. I wanted to learn how to make an Android game; I didn’t know what game to make so I simply replicated Frogger except with a dog instead of frog (the game is called Dogger). This is about as unoriginal as you can get, but I had fun making it and learned a lot in the process. I’d even say that it might be better to clone an idea first, this way you’re not caught up in the design/ideas – just straight codin’.
Secret to life #2: Have a strong forehead
What does it mean to have a strong forehead? It means that it is resilient to banging – whether it be from your hand, your computer or some other object. Programming is hard. There’s no way around it – you’re going to come across problems you don’t know how to solve and you will end up slapping yourself on the forehead time and time again. The persistence to get through them is essential. If you can persist, learn to solve problems, then this will make you better than even the prodigal programmers whose first word was integer.
The ability to overcome obstacles is a much more valuable skill than unparalleled brain power. In the real world, problems need to get solved and often times whoever comes up with the quickest viable solution wins (obviously not always the case). Even the smartest find themselves humbled when faced with a problem one time or another; if they don’t have the wits or the experience to plow through, then all those smarts are a waste.
One last point on strong foreheads. Like everything else in life, a strong forehead can be acquired. It doesn’t necessarily have to come from programming either. Problems arise every day and every day you are presented with the choice to solve the problem or give-up. There are obvious times when giving up is necessary, but the vast majority of problems can be solved with a little perseverance and going the extra mile. That being said, take it to heart next time you find yourself in a pickle and work to get yourself out.
Secret to life #3: No shortcuts
In order to become a great coder you need to practice great coding (yes, I’ve read All code is crap, but there are definitely varying degrees of crap and you want to be on the less crappy side). If you realize you messed up your class hierarchy in some program and find yourself making quick hacks to make the system work, stop what you are doing and rewrite the class structure properly. This will give you invaluable experience on creating great object oriented structure and the next time you do it, you’ll make fewer and fewer mistakes. Some say the best software engineers are approximately 10-100x more productive than their lesser counterparts. Part of this productivity is their intuition to see the problem as a whole, design a solution that fits the problem and allows for expansion. This isn’t some inherited skill, it comes from making mistakes and learning from them. So, yes, make your mistakes, but fix them or at the very least understand what went wrong and where you can be better.
Secret to life #4: Become a codeworm
How do you know what sub-optimal code looks like? Reading other people’s code is a great way to see some great examples of what your code should look like. Now-a-days there is no excuse for not being able to find code (github, sorceforge, etc). Be warned though there are also very bad examples of code on the web as well, but you can learn just as much from those. I’ll admit it’s hard to straight up read someone else’s code and that it’s much more fun to write your own, but if you find some program you want to extend/fix, it makes it much more enjoyable.
Books and papers are also great resources for learning to code well. In case you haven’t seen this post, it points you to some good papers to start on. As important as it is to read and learn other people’s code, don’t spend too much time reading – focus more on the doing.
So there it is, 4 easy-peasy secrets to becoming the next Don Knuth or Mark Zuckerberg. These are things that I’ve learned throughout my struggles in the programming world as well as in everyday life. The only hard part is actually doing it.