top | item 31445585

(no title)

edvald | 3 years 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.

discuss

order

quickthrower2|3 years ago

That sounds good within a feature branch but you wouldn’t merge those to main, right?

edvald|3 years ago

No 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|3 years ago

to 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.