michael-mccracken.net

The editing pass

Anything worth writing is worth re-writing. This applies to code as well as prose.

I give paper sections and important emails a while to sit after I write them, and they always benefit from another look with fresh eyes. I think that doing this with code is worth thinking about.

Once you get a piece of code to the point where you believe it works - it’s passing its tests - go back over it and edit it. That is, go back and edit it for clarity, flow, and style. Just as if it were an essay.

This is particularly important for tests. If a test fails, it should tell a clear story that explains exactly what failed, and what it was expecting.

Things to consider editing out are vague variable or function names, and non-idiomatic shortcuts. Control flow can get tangled when working out a solution. Make it obvious. One-liners often don’t tell the full story. When you come back to a piece of code, you know the chase. It’s the first loose thread of a bug, a failed test, or an occurrence of a symbol you need to refactor. What you need is the story around it, and solid code will fill that in.

You can learn this by sharing your code or by waiting a while and reading it over again. It’s easier said than done - I don’t always do it, but I do know: an editing pass can do you good.

Something to think about: would a professional code editor help or hurt in the long run?

Previously:
That Windows feeling
September 4, 2007

Uninvited dialogs popping to the front or stealing keyboard focus in OS X have been giving me that Windows feeling lately. I give a few examples in the full post.

read the rest.
Skim 0.7
August 31, 2007

The amazing Christiaan Hofman has released another nice update to Skim, the great PDF reader that is quite literally my dream reader app.

One feature in particular made me write this post.

read the rest.
Processing Email
July 26, 2007

I watched Merlin Mann’s Google Tech Talk about processing email yesterday, and even though I’d followed his posts on Inbox Zero when they came out, it’s good to get a reminder, and Merlin’s an entertaining speaker - I recommend you watch it.

He talks about strategies for keeping an empty inbox based on processing email as [...]

read the rest.
« Previous PageNext Page »
Feed, Endorsements & other Links

my bookmarks

© 2005 - 2007 Michael McCracken.