Live data from Hacker News

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

todos.tickgit.com

1–10 of 301 posts

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

#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 seem to come down to nomenclature differences.

In my own work, the code is liberally sprinkled with "Note:"s. These are, as others have pointed out, useful for providing context of what is going on, why, how it is non-optimal, etc.

TODOs that I come across tend to be of the "You ain't gonna need it" variety. If you can get a pull through review as-is, then the thing wasn't actually a "TODO", and if it was, then it should be added as a ticket to the backlog.

XXXs tend to show up in the reviews I do as code that is explicitly meant to be fixed before the pull is merged.

So to summarize:

1. "Note:"s in code are great.

2. "XXX" shouldn't survive the review

3. "TODO" should be handled by the ticketing backlog to better separate out "actually needed" from "theoretically nice, but not necessary in practice".

Further, things that are "TODO" today often make zero sense as "TODO" in a year when the code has grown and evolved more, but since someone put it in as a TODO, I find that they rarely ever get removed since "surely someone knows what that means" (but that person is usually either gone or no longer remembers).

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

#3
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.

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

#4
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…

I've been in many scenarios where fixing a certain behavior or implementing something in an optimal way requires a change in an external or upstream product. Or it may require a larger refactoring that's in discussion or otherwise outside the scope of the quick fix. "Either fix the problem immediately or accept that it's going to be wonky forever," sounds like a nice ideal but it's not practical to treat it as an absolute.

What I usually do is link the TODO with the associated Github issue/bug tracker (in the commit message too, so it shows up as a reference) to avoid the TODO being forgotten when its blocker is resolved.

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

#5
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…

Doesn't that just fall under the "don't let perfect be the enemy of good" ethos?

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

#7
I'm amazed it is that low.

There's always stuff that wants doing, but not just now. Except now doesn't come, and those todo notes, like most comments, get ignored forever, peoples' eyes skipping straight over them like they were never there.

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

#8

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.

Correct me if I'm wrong but I use "FIXME" for this intent. I keep TODO for stuff actually left to implement.
Post reply on HN