I Want Your (Comments On Your) Code
At the start of term, I had my CSC301 students do a code review on the Speed Scrabble referee the TA had written. They found a handful of out-and-out bugs, and made another handful of suggestions about ways the referee could be improved. I’d like to do this exercise again in future courses, but to be fair to the students, I would first like to show them examples of what a code review is supposed to produce. When I look on the web, though, what I find is:
- General guidelines, like Macadmian's code review checklist. Most of the items on this list could and should be checked by tools (Checkstyle, FindBugs, etc.); the rest won't mean much to students without examples of depth and scope.
- Examples of code that's really bad (e.g., the Daily WTF), or, less frequently, really good (even beautiful ;-)).
What I need is code snippets of average quality that are 2-4 pages long (say, a couple of hundred lines), plus commentary on those aspects that can’t be checked by machines (architecture, algorithm choice, etc.). If you’d be willing to contribute a few examples, please let me know: I’d be happy to trade pizza, beer, or whatever else you need that’s cheap (including public recognition).