We’re two weeks away from the coding cutoff, so I’ve got students doing code reviews. For most of them, this is the first time in their lives that they’ve marked someone else’s code, and had their own examined line by line. (They’ve all had plenty of code marked, of course, but with an average of 70 students in a course, TAs can’t give the kind of detailed feedback students we all wish they could.)
Coincidentally, I had to do a little code review of my own this morning. I decided earlier this week to move my online bookmarks from Bookmark4U to del.icio.us. The ever-useful Adam Goucher found a Python module for working with del.icio.us, so I downloaded all my old bookmarks, and wrote a 10-line script to parse that data and upload the links and tags to del.icio.us. Simple, right?
Wrong. For some reason, all of the entries were showing up tagged as "system:unfiled", and the tags themselves were showing up as the extended description of the link. A quick check showed that I was calling delicious.add() correctly, so I started tracing the code. It only took a couple of minutes to discover that delicious.py‘s author had reversed the order of a couple of parameters in a nested call. Tweak tweak tweak, rerun my script, and all is now good. (See my del.icio.us page for my links.)
This experience reinforces conversations I had earlier this week with two different colleagues at U of T—conversations that I’m sure thousands of instructors around the world have had over and over again for the last thirty years. We teach students how to write code, but we never (or hardly ever) teach them how to read it. With the exception of Spinellis’s Code Reading, I don’t even know of any books devoted to the topic. I’d love to make this part of the standard undergraduate curriculum, so that students could tackle coursework using realistically-sized code bases (such as the OS simulator used in CSC369), but I honestly don’t know what I’d drop to make room for it…
Hi Greg,
Its been a long time! I certaintly agree with your sentiments on code reading as being an essential skill for software engineers. Not only is it a necessary skill to work effectively in a software team, but it is also one of the best ways to learn tricks from the masters. Certaintly not something that is emphasised in a university course.
On a related note, code reviewing is a slightly different, but related skill, also essential for software engineering teams. I developed (warning, minor plug approaching) a very simple web application for reviewing code designed for software teams called Codestriker, at codestriker.sf.net, which we use day-to-day for reviewing our code.
Cheers,
David