Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Like said already create a ticket instead of a to-do.

But also, instead if writing todos, explain the context and reasoning behind what needs to be done instead. In the future when this code is visited again this will help you or others to get into the right mode to make a proper decision about what to do with this code. Maybe the reason to do something is no longer valid, if the intention is properly documented the decision can be made at that point. This allows for proper refactoring instead of skipping todos and keeping code for legacy reasons.

So instead of: //todo: remove this code

Do: // required for legacy API clients, should be removed after last client is deprecated.



> //todo: remove this code

IS fine when the code isn't "finished" within one ticket/cycle etc. After that it needs more detail - However whether there is a ticket or not, I'd still add a TODO (that refers to the ticket id), so that it is more discoverable.

There just as great a risk that information gets lost in the ticketing system.


Nothing as permanent as a temporary solution.

I've seen countless todos that would be resolved the next sprint/day but never where due to priority shifts or 'it works'.

It also doesn't matter wether you loose track of a to-do in your ticket system or your codebase. You will loose it and that can be ok. As long as context and intentions are documented with the code. External or even in repo docs often get forgotten to be updated. Document where it counts.


> Nothing as permanent as a temporary solution.

Maybe so, but what does "doing them immediately" solve if you're pushed for time anyway?

> It also doesn't matter whether you loose track of a to-do in your ticket system or your codebase

No, but it does matter if one is more likely. If a TODO is listed right next to the code, anyone who begins working on it has that context immediately.


I'm not suggesting to solve them immediately, I was merely stating even the smallest temporary solution will stay around for longer than expected at that time. Instead of leaving only a todo (issue tracking) in code, leave a decent context in code so it is not lost no matter what issue tracking system is used. Using codebase as issue tracking is fine as well. But issues will get forgotten or become irrelevant. Having just todo's with no context (ticket was removed from old issue tracking, issue was never tracked) just creates legacy code which is hard to refactor or delete without proper time investment.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: