Experiment with Literate Programming Didn’t Work Out

About a year and a half ago, I tried doing some “literate programming” for one of our internal scripts. Well, I have just converted those scripts back to the normal, un-literate (illiterate?) style. It just wasn’t working out.

Continue reading “Experiment with Literate Programming Didn’t Work Out”

3 Steps to Understanding Ungrokkable Legacy Code

On Friday I was faced with making some changes to some old code that nobody really understood. Nobody liked to go into this code, so nobody was familiar with it. I too dreaded to make changes to it, and only dipped my toes in it as little as possible to understand what I needed to know.

Well now I needed to understand it better in order to make a bug fix. It turned out to be a good opportunity to learn what this code was doing and make it easier to understand.

Continue reading “3 Steps to Understanding Ungrokkable Legacy Code”

PHP Tip: The identity function I()

Here’s a tip I picked up from another PHP programmer. It’s called the identity function, and it simply returns its argument:

function I($subject) {
    return $subject;

Now what so great about that, you ask? One cool thing is that it allows you to instantiate an object and call a method on it, in a single statement:

I(new Foo())->bar();

Continue reading “PHP Tip: The identity function I()”

Code Reviews at Ning

At Ning we use a code-review system called ReviewBoard. This is a web application that shows you a commit diff and lets you click on lines to comment on them. The committer gets an email notification, and can leave a followup comment, etc.

We’ve set it up so that whenever anyone makes a commit, a review is sent to a couple of random developers, who may or may not be on your team. I’ve found this to be a good way to learn about what other teams are doing.

Continue reading “Code Reviews at Ning”

The Joys of the JavaDoc Style Guide

When I need to do maintenance on code that has been JavaDoc’d, my heart sings. There’s something about code that’s been JavaDoc’d that makes it so much more pleasant to work with. Look at the source code for any class in the JDK.

There is some wonderful top-level doc for the class, explaining its purpose, and also rewarding the reader with some finer points about the implementation. Then each method (even private methods) has some doc explaining the intent, descriptions of the parameters, and any gotchas.

Continue reading “The Joys of the JavaDoc Style Guide”

The Scrum Process, and Notational Velocity

At Ning, many of our teams use the Scrum process to manage our work. I’m a software engineer on one of the teams (“A-Team”), which has a mix of people: two software engineers (me and Chris), a QA engineer (James), a Product Manager (Evan), and a Manager / Scrum Master (Patrick).

Every Tuesday we have a 20-minute demo (for executives) followed by a 1-hour planning session, in which Evan shows us the stories he has written for the upcoming week, and we all brainstorm 5-6 tasks for each story. A good thing about this planning session is that we can get input from Evan and James, even on development tasks, and we can give them some insight into our thinking from a programming point of view – this sometimes reveals assumptions that we are making that they then correct.

Continue reading “The Scrum Process, and Notational Velocity”