GarethTownsend.Info
Much Ado About Todos
How many times have you come across a comment block in a piece of code like this?:
# TODO – Make this work properly for all cases.
At some point in time this comment made sense. Someone, somewhere had every intention of fixing this and removing the comment.
It’s quite possible that someone was you, but you don’t remember anymore.
todos are irrelevant
todos live in no-mans land. Stuck in a time warp for all eternity. Don’t kid yourself, you’re never going to re-visit a todo. They’re irrelevant.
They fly under the radar because they have no visibility. Out of sight, out of mind. If you’re not working on the code with the todo, then you don’t know it’s there, and you don’t care.
Other than doing a project wide search, you’re never going to find them all. Even if you do, you’re not going to understand the meaning of them all.
They’re irrelevant.
making todos relevant again
What’s the point of a todo list if nobody knows about it?
Take control of your todos and enshrine them in code that everyone sees every day. Write them into your test suite as pending tests.
Failing tests are bad. Passing tests are good. Pending tests are just plain annoying.
They clearly indicate that something hasn’t been finished properly. They’re visible every time you run your test suite. This means they annoy everyone until they’re fixed.
They define todos better than any other mechanism at your disposal.
Sprinkle in a touch of guilt
While a quick flick through svn blame will find the culprit, it’s not visible and it means work on your behalf.
Sprinkle in a touch of guilt by mandating all pending tests be created with the Authors name and todays date in the pending message.
That’ll ensure they don’t hang around like a bad smell for too long.
