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

TODOs are a code smell.

If there's a known unhandled edge case there should be conditional logic guarding against it.

If the original author dislikes the idea of a refactor... well too bad it's not their decision anymore, but they should have at least been kind enough to write tests.



This is unrealistic, or possibly you just haven't used platforms/languages that benefit from a layer of record-keeping lower than is appropriate for a ticket-tracking system.

Also, a TODO doesn't mean you have not guarded against an edge case. A TODO could be anything that increases the health of the codebase or application. You can guard against an edge case, and then write a TODO on that guard that mentions that you'd like to recover from the edge case, rather than simply guard it.


>This is unrealistic

While I don't necessarily agree with GP, this isn't a refutation. Yes, eliminating code smells entirely is, in typical development environments for sufficiently large projects, entirely unrealistic. That doesn't make them not smells.


Sometimes, it's "there is something wrong here but I cannot figure out a way to make it better yet without working nights and weekends for the next three months with no benefit to myself."


TODO: Remove the 'FillInData' function call after bug/<id> is fixed.


There is always an unhandled edge case




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

Search: