Programming is like training for a sport. Programming is a lot like training for a sport. If you are on a sports team, or take dance classes, or even just meet a friend regularly to go to the gym, you should know a few things about the benefits of regular training. And learning to program a computer is exactly like training regularly.
Here are some of the issues we've seen surface over the years, reinterpreted in sporting terms:
Computing: "I didn't have time to do the assignment, so I copied off my buddy."
Sports: "Coach, I didn't have time to swim all the 100 laps you asked for, so I just swam 20 and I got my buddy to swim the other 80 for me. But I'm sure I'll be ready for the competition."
Computing: "I knew I blew the test, but can I have make up work"
Sports: "I know the race is over and I didn't do very well, but can we run it over again to see if I do better"
Computing: "I know I didn't do very well, but I came to every class."
Sports: "I know I didn't perform very well, but I attended every practice."
Computing: "What does it matter if my code is not the fastest or cleanest It works and that's what counts."
Sports: "So I like to swim the race in a tuxedo or evening gown. So what I still got to the finish line."
Computing: "I don't have time to study now, but I'll stay up all the night before the exam and cram."
Sports: "I don't have time to practice now, but I'll stay up all night before the big race and practice then."
Computing: "The first few weeks of programming were easy. I'm sure the rest of it is just as easy."
Sports: "The dance steps we learned in the first couple of weeks were so easy. I'm sure the choreography doesn't get any harder."
Computing: "I was a whiz in programming in high school. I've nothing left to learn."
Sports: "I was the best athlete on my block. I'm sure I'll win every race from now on."
Computing: "I know Java. Why am I learning Python?"
Sports: "I know CFL rules, and even though I'm playing in the NFL now, why do I need to learn their rules And, also, I only ever practice a single sport--there's no way other sports could make me a better athlete."
Computing: "I just keep tinkering with the code until it runs. I don't really need to plan it out ahead of time or understand how it works."
Sports: "I just keep hitting the golf ball towards the flag. I don't really bother to line it up or improve my swing or putting. Eventually I always get it in the hole."
Computing: "I can only program on the computer. I don't know why I need to be able to do it with a paper and pencil."
Sports: "I know you can't see my swimming kick properly if I don't show you on land. But I can only do it in the pool."
A final (non sporting) word from the inventor/developer of the game Minecraft:
The Word of Notch, Blog entry, Jan. 13, 2012.
I used to think I was an awesome programmer. One of the best. After I made a game in the first programming lesson in school, I got told to don’t bother showing up for the rest. I was the one who taught all my friends what big O notation is and how it’s useful, or why hashmaps can have an effective constant speed if used right.
When someone told me I was a bad programmer, I got upset. My identity was based on being The Best Programmer, and being accused of not being one was a huge insult. Of COURSE I wrote bad code sometimes, but that was just sloppiness or part of some grand scheme, or some other weak excuse.
When doing a programming test for a large US based game developer, I did well on most tests. After the programming test, they told me it was obvious that I was intelligent, but also that I was self-taught. I had to work on programming more carefully and think things through before diving in, or I’d have a hard time working in a large group. Externally, I nodded politely. Internally, I was stunned and confused.
That kind of woke me up. Ever since, I’ve been working on improving my coding skill. During my work on Minecraft, I never really got a chance to try out new things, or play with new tools, but these days I’m really trying to learn new things and pick up better habits as much as I can. And as a result, I’m having even more fun with the programming. At the moment, I’m trying to tame GIT, playing around with MongoDB, trying out some static code analysis tools, and have started working on making my code even more modular and reusable.
The more I learn, the more I realize how little I know.