Monday, March 21, 2011

The 3 Most Important Things a Programmer Must Know

Write code, run code, fix code is essentially what a programmer does, said the speaker at an intriguing talk I recently attended, hosted by the Perl Mongers group. Zed Shaw is the author of Learning Python the Hard Way and in review, I have to agree with this user-generated comment:
Very knowledgeable not just with Python, but he has a deep understanding of programming. He inspired me to be a better thinker and programmer.
I was interested in this talk because Zed Shaw made a name for himself by coding the Mongrel web server, as well as Mongrel2, both of which were and are integral parts of Ruby on Rails. I looked forward to the rather unique confluence of a core Ruby on Rails programmer giving a talk about Python at a Perl meetup. I had a prior discussion with a female attendee at a Ruby on Rails Workshop for Women on why religious wars in technology were so prevalent; some people get worked-up over a particular choice of scripting language (Perl vs Python vs Ruby) or text editor, and soon flame wars ensue on the internet about which technology is best. Rodney King asked us after the Los Angeles riots, and Zed is living proof that we can all get along, at least when it comes to scripting languages.

Zed took a year off to learn jazz guitar. He realized, when learning music, you have the concept of a trainer, who tells you to play individual chords multiple times until you get better at it. Then the trainer tells you to play another chord, and then play a song in both chords, in a progression, until you have some experience under your belt. Whenever you want to learn something difficult, it's hard to explain the ideas unless you have some experience under your belt. Using this same principle, Zed decided to introduce the beginner to simple coding exercises, until you get better at writing computer programs, and then he slowly introduces the concepts to you.

The fact that Zed was able to use an analogy from music learning in explaining hard-to-grasp concepts in computer programming makes his experience valuable and his book a must-read for me. Zed strikes me as hard-working, dedicated to his craft, and he knows something about how to get beginner programmers engaged in a new, complex, but rewarding venture. One last thing he said that really hit home for me: Zed recommends learning parsing and lexing, the two most important things, other than algorithms, that a programmer must know. Right now, Zed is doing C and Lua, and he mentioned software called Corona that enables the Lua programmer to write iPhone games.


  1. I prefer adding a couple of extra steps:
    Write tests
    Write code
    Run Tests
    Fix Code

  2. Well said, with one caveat: writing tests is hard.