Live data from Hacker News

The Linux codebase has over 3k TODO comments, many from over a decade ago

todos.tickgit.com

31–40 of 301 posts

Re: The Linux codebase has over 3k TODO comments, many from over a decade ago

#31

Earlier quoted context omitted.

To me, FIX implies that something is wrong, not that it works but could use improvement. I would like to have a tag for "here's something that works, but could be improved" though!

Pray tell, what line would you NOT put that tag on? That's like, all code...

TODO is for when you know something specific that can be improved and want to document it, not just generally that nothing is perfect.

Re: The Linux codebase has over 3k TODO comments, many from over a decade ago

#32
I use this pattern across my codebase for the "critical functionality missing" scenario:

  #if DEBUG
  #define TODO(msg)
  #else
  #define TODO(msg) #error msg
  #endif

Works like a charm. I've got another PRERELEASE() macro that lets you do an unofficial preview build, but would break an official stable release.

Re: The Linux codebase has over 3k TODO comments, many from over a decade ago

#33
post #2

In my opinion, any comment prefixed by TODO, XXX, or the like should not survive past the review stage. Either fix the problem immediately or accept that it's going to be wonky forever. Edit: Amending here to avoid replying to ten different threads individually. 1. Long-term improvements should be managed by a ticket tracking system. The code is not the correct place to manage that. 2. Most of the disagreements below…

Let us know when you ship your perfect alternative to Linux.

Re: The Linux codebase has over 3k TODO comments, many from over a decade ago

#34
post #19
post #14

Earlier quoted context omitted.

Serious question as someone who drops XXX occasionally: There are all sort of places where you want to note "there's probably a better way to do this" or "maybe look at this edge case" or whatever. Not all of those are important enough to address in the next review/sprint/whatever...why isn't it better to leave them in and keep that tribal knowledge around rather that delete them and loose that insight? Maybe a bette…

I think these sorts of notes belong somewhere external of the code itself; an issue ticketing system or whatnot. Because more often than not, I find those "TODO"s lose meaning over time. They often suggest a particular way to solve something, but by the time we might come back to fixing it, that solution is no longer the best way to do it. A ticket can better express the problem , so that we can evaluate and triage h…

Interesting perspective. I don't per se disagree, but my gut feeling (that is, I have no idea if I'm right) is that the farther away from the source code those notes get the less likely they'll ever get looked at much less addressed. I think your view requires more discipline, which, of course, is what we should be striving for.

Re: The Linux codebase has over 3k TODO comments, many from over a decade ago

#35
post #2

In my opinion, any comment prefixed by TODO, XXX, or the like should not survive past the review stage. Either fix the problem immediately or accept that it's going to be wonky forever. Edit: Amending here to avoid replying to ten different threads individually. 1. Long-term improvements should be managed by a ticket tracking system. The code is not the correct place to manage that. 2. Most of the disagreements below…

What's the advantage of throwing away context that could be useful in the future? I've taken ownership of codebases with technical debt before, and when modifying the code for something time-sensitive, I often annotate issues with the code whose solutions (usually refactoring) can't be fit into the timeline of the current project. I (or others) can then take advantage of these annotations when I have time to dedicate to refactoring, or in many cases, fit the refactoring into feature work. The fact that a portion of the design groundwork has already been done (as captured by the TODO) makes it easier to fit in the cleanup work. IME, this approach leads to much more rapid improvement of legacy codebases than your description of do-it-now-or-forget-about-it.

Re: The Linux codebase has over 3k TODO comments, many from over a decade ago

#36

Earlier quoted context omitted.

To me, FIX implies that something is wrong, not that it works but could use improvement. I would like to have a tag for "here's something that works, but could be improved" though!

Pray tell, what line would you NOT put that tag on? That's like, all code...

I don't want to brag about my skills, so I won't answer that.

Re: The Linux codebase has over 3k TODO comments, many from over a decade ago

#38
post #2

In my opinion, any comment prefixed by TODO, XXX, or the like should not survive past the review stage. Either fix the problem immediately or accept that it's going to be wonky forever. Edit: Amending here to avoid replying to ten different threads individually. 1. Long-term improvements should be managed by a ticket tracking system. The code is not the correct place to manage that. 2. Most of the disagreements below…

That's a terrible advice. When I worked at Google, many code reviews added more TODOs because the reviewer identified a potential source of problem but also correctly decided that fixing it right there was not the best use of developers' time.

When code has potential issues, I want it to be marked with TODO which basically says "The original developer was not an idiot, but was working with limited resource and the best way to fix the issue wasn't clear then."

Re: The Linux codebase has over 3k TODO comments, many from over a decade ago

#39

I use TODO in my code all the time as shorthand for: "This code is functional, but if you are going to do another iteration you may want to consider the following improvement or optimization." It's not at all meant to be to be like an item in a TODO list. Code would be a terrible place to keep that.

Then write a regular comment, why use TODO at all?
Post reply on HN