5 ms·
One trick I employ for myself is: throw "TODO" // <comment with some additional context to remember> Substitute for your language's syntax of course. I fin
by edvald 4y ago
One trick I employ for myself is:
throw "TODO" // <comment with some additional context to remember>
Substitute for your language's syntax of course.
I find this especially handy when writing test specs, but it's also handy when creating new functions etc. For tests I lay out the test descriptions with just this one line in the function body. For new functions/methods I can define the function and its return type (assuming a type-safe language) which makes the code using it compile, but leaves the implementation TBD.
The placeholders are then implicitly flagged in test runs and easily found. Basically my text search results for 'throw "TODO"' become my TODO list.
- quickthrower2 4y agoThat sounds good within a feature branch but you wouldn’t merge those to main, right?
- edvald 4y agoNo definitely not, this is just for WIP branches. I usually don’t even push these, unless it’s something big that I need early review on.
- Groxx 4y agoto be fair, that is what the linked post is talking about :) so super-explicitly breaking things serves pretty much the same purpose, as long as you have attentive reviewers and/or tests that touch that code.