DEV Community

Discussion on: TODO in code

Collapse
 
leightondarkins profile image
Leighton Darkins

This is one of the few topics that I have a simple, and clean cut opinion on. But you know what they say about opinions...

If you're writing a TODO comment, that means you've written or discovered some code that needs some attention. So give it the attention. Now.

If you're writing something new, TODO's just shouldn't be a thing. Unless circumstances really restrict you, you should endeavour to write something cleanly and correctly the first time. If you were feeling out a problem and the code got messy along the way. Clean it up before you say you're "done".

If it's a small thing, like refactoring a function for readability or to match some particular code style. Just do it on the spot.

If it's a bigger issue that'll take some time to fix, it's time to start a short tech huddle to talk about the issue with some members of your team. From there a bug, tech task, github issue, sticky note, whatever should be created and prioritised with the rest of your work.