3 ms·
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
by sublinear 1y ago
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.
- happytoexplain 1y agoThis 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.
- zahlman 1y ago>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.
- ebiester 1y agoSometimes, 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."
- blitzar 1y agoThere is always an unhandled edge case
- gabrielhidasy 1y agoTODO: Remove the 'FillInData' function call after bug/<id> is fixed.