4 Nov 2007, 1:30am
/dev/random
by

2 comments

Write the Code, Not the Comments

Long, long ago, eons ago back in 2005, Wil Shipley wrote a poignant piece of programming advice, this fragment of which sprang to my mind just this evening I was digging back through an old bit of my own code:

Write all your code “clean,” the first time you write it. Make classes for everything. Use enumerated types. Don’t take shortcuts. Don’t have any part of the code where you say, “Oh, yah, I just glossed over that for now.” You are NOT going to go back and fix it. Seriously, how often do you say to yourself, “I think I’ll dive into this messy code today and try to make it nice and pretty without adding any functionality?”

- Free Programming Tips are Worth Every Penny

The trigger for this memory? An old comment I’d left, presumably for a smarter, less time-pressed self:

<%# TODO: For the love of all that is sacred, make this recursive! %>

I should have listened to me back then. If I had I wouldn’t be up at 1:30am refactoring to do exactly that.