Re:I've never seen a language's style guide recommend avoidi...
by dllthomas on Wednesday July 23, 2014 @07:21PM
(#8077478)
If you're systematic about the syntax of your TODO comments, you can also 1) jump to them, 2) traverse them in order of priority, 3) automatically surface changes to the list of TODOs as comments in commit messages, and 4) use commit hooks to refuse to commit code with overly severe TODOs to certain branches.
Re:I've never seen a language's style guide recommend avoidi...
by notduncansmith on Wednesday July 23, 2014 @10:55PM
(#8078024)
I do 1) pretty frequently, and while I don't go so far as 4), I do use total TODO count as a heuristic from time to time.
I also find TODO comments quite helpful. It requires far fewer brain cycles to process a TODO comment than to parse the code, figure out what it's doing, and make an assertion that it's incomplete.
Comments can also make code much more approachable to junior programmers, who may not have heard of principles like Tell Don't Ask, or Composition Over Inheritance. When I'm working with a junior dev, I find that comments usually reduce the number of interruptions I receive that are along the lines of, "Hey why did you do this thing this way?"
Really, it's just not a good idea to make sweeping generalizations like, "Comments are always failures". The real world has time and budget constraints, and comments are sometimes the most effective way to satisfy those without screwing the next developer to read the code.