Skip to content(if available)orjump to list(if available)

TODOs aren't for doing

TODOs aren't for doing

154 comments

·July 22, 2025

nevermore

As a proponent of "TODOs should always point to a concrete issue", you have 3 ways to resolve a TODO before merging:

1. Just file the issue. If it's something you should actually do, you can take 20 seconds to write it down and track it. 2. Just do it. If it seems like too small of a thing to file an issue for, fix it before you commit it. 3. Turn it into a comment. If it's not worth fixing and not worth tracking, but you want to remember it, that's a fine thing for a regular code comment.

Eat your broccoli. Track your todos.

pornel

Tracking in external system adds overhead not only for filing the issue, but also for triaging it, backlog management, re-triaging to see if it's still a problem, and then closing it when it's finished. Issues in an external systems may also be overlooked by developers working on this particular code.

There are plenty of small things that are worth fixing, but not worth as much as the overhead of tracking them.

TODO in code is easy to spot when someone is working on this code, and easy to delete when the code is refactored.

LeifCarrotson

I think the key distinction is that tracking in an external system exposes the task for triage/management/prioritization to people who aren't reading the code, while a TODO comment often leaves the message in exactly the spot where a programmer would read it if the possibility of a problem became an actual problem that they had to debug.

In my experience, these can often be replaced with logger.Error("the todo") or throw new Exception("the todo"), which read about as well as //TODO: the todo, but also can bubble up to people not actually reading the code. Sometimes, though, there's no simple test to trigger that line of code, and it just needs to be a comment.

pc86

> Tracking in external system adds overhead not only for filing the issue, but also for triaging it, backlog management, re-triaging to see if it's still a problem, and then closing it when it's finished.

Which is already what you're doing in that system, and what the system is designed for.

Source code is not designed to track and management issues and make sure they get prioritized, so you shouldn't be using your source code to do this.

We add TODOs during development, and then during review we either add a ticket and remove the TODO, or fix the issue as part of the PR and remove the TODO.

OrderlyTiamat

You can leave the TODO in the comments- e.g. ruff the linter has an optional rule to disallow TODO comments unless it's followed by an issue url.

If you put that in the CI, then you can use TODOs either as blockers you wish to fix before merging, or as long term comments to be fixed in a future ticket.

nonethewiser

I think the author is basically arguing for #3 but not addressing the difference between a `TODO` comment vs. a non-`TODO` comment.

I guess the `TODO` terms has a certain visual flair that makes us immediately understand the class of comment. I guess that would be my best argument for keeping it a `TODO` comment instead of a regular one. But when you see the author arguing that `TODO` comments dont mean you need TO DO anything, it's kind of a smell, isn't it?

I find myself generally agreeing with the article's sentinment but think your option #3 of just making it a non-TODO comment an improvement.

hinkley

Am I hallucinating or did IntelliJ have a TODO tracker? Webstorm doesn’t bug me about todos, but something I used to use did.

nilamo

Rider definitely has a popup with a list of TODOs before you push to the remote. I assumed that originally existed in intellij... but never verified that.

skydhash

It still does. But it’s a user option to run the scan when commiting (or pushing). So it may be disabled in your config.

mcntsh

I wish tracking took 20 seconds. In my org (big tech) a JIRA ticket has 10+ required fields.

hinkley

Jira is awful because it has no opinions and leaves those decisions up to people who have terrible ones.

indoordin0saur

Jira really seems to have degraded as it has become increasingly bloated. I grit my teeth every time I hear platform ops say "hey, that deployment ticket last week... we noticed you didn't fill out the x, and z fields and also didn't create a follow-up ticket for future deployment to prod with the correct link to the implementation ticket"

zargon

It feels like it takes 20 seconds just for the Jira page to load.

happytoexplain

>take 20 seconds to write it down and track it

You've described a TODO.

If I were to elevate it into a ticket system, besides obviously taking longer than 20 seconds, it would be a distraction, not a help.

hinkley

I was just having this conversation with myself for another reason this morning (trying to define why automating processes is a force multiplier and mistake reducer). Because there’s little to no IDE integration for ticket tracking, swapping to the ticket system is a context switch. And the ticket system has ways of demanding your attention once you’re in there. If it succeeds now you’re pre-empted.

The thing about concurrency is that as long as you don’t know about a priority message you can continue to make progress on the task at hand. The moment you are aware of it you have to deal with it or have to explain yourself later. “I didn’t see it” goes a lot farther than, “I did but I was busy.”

My ex would try to check her work email on a Friday evening as we were on our way out the door for a trip out of town. A trip her boss likely knew about. That’s not why she’s my ex but it certainly didn’t help. That email arrived after you already left, lady. That’s your story and we are sticking to it. Don’t go looking for conflict, particularly when doing so affects people other than yourself.

AnotherGoodName

I personally have no problem with the forcing function of a policy that makes you add a todo to a ticketing system.

It sets a bar for the todo to be at least more complex than creating a ticket. Any less and you can just do what the todo says to do.

cjbgkagh

Make the bar high enough and people won’t bother to do either and instead just hope for the best or keep their own list of TODOs elsewhere.

The point of a cheap informal method is to as low of a bar as possible so that more information is collected. As for always immediately fixing that’s the same as making everything the top priority, the true priority is lost.

Too many TODO comments and not enough tracked issues, that’s a sign that issue tracking has too much ceremony. Ban the use of TODOs and you lose even that information.

Perhaps a codebase could be watched such that new tracking issues are added and tracked implicitly when checked in by searching for new TODOs in the code. Similarly the tracking issue could be closed when the corresponding TODO is deleted from the code.

1980phipsi

I think the key point is that if you put a TODO comment in the code, it should be resolved before merging. If it's important enough to leave in there, it should be an issue. I only use them as something to grep for and so that I don't lose my train of that as in "oh I need to fix that but I'm working on something else at the moment, write the TODO, finish what I'm working on, then go back to the TODO".

hinkley

If the todo is code you’re working on, yes.

If it’s a WTF about code that is next to the code you worked on, no. Boost the WTF ratio of code that deserves it.

scosman

Yes! I often add a CI check that TODOs are removed before merging a PR. Have them all you want in your branch, but do one of the above 3 things before merging (sometimes any `TODO`, sometimes `TODO_P0`).

I find CI integration also makes TODOs more helpful. You can use them to track a genuine TODO in a working branch, but CI will make sure you don't miss them.

indoordin0saur

Title is a little click-baity but I fully agree with the sentiment. Just minutes ago I had this experience where a #TODO marked out some extremely rare edge case to handle but one that I have never seen actually occur in the 2 years since I put it in there. Still it will be useful to others (and future me) when I look back at the code and wonder why something wasn't handled.

I also agree with users that sometimes these should just be comments. Really depends on your environment and since I work on a team of 2 who maintain my portion of the codebase I stick with using TODOs in this way (seomtimes).

MathMonkeyMan

I was on a team that used `// TBD: [...]` for this purpose, so that the "TODO people" wouldn't notice.

pisipisipisi

I add and grep for the following:

- FIXME: this is clearly broken/wrong and highest priority

- XXX: this is “ugly” or assumes wrong things, probably higher than next

- TODO: at some point, implement a whole different approach/category/branch

- NOTE: code comment with a higher importance than just random comment

NOTE: I work a lot with old/unmaintained codebases where “code is truth”, so there is no “jira ticket creation” but amending things as you read.

marksomnian

I like this style. In a project I worked on we had CI reject any FIXMEs outright and any TODOs that weren't accompanied by an issue ticket[^1], so the hierarchy would be

FIXME: I am leaving a note to myself to not get distracted, but this code is not considered finished/mergeable until it's resolved

XXX: this needs fixing soon, but the code will still be functional without it

TODO: this needs revisiting but the code is perfectly useable without it - a lower priority FIXME

NOTE: this does something unusual and you need to bear in mind while working on this code

[^1]: the value of doing (or not doing) this is a subject that has already been extensively rehashed in sibling comments

p0nce

I'm using:

- TODO: will be needed before release, mandatory or else turn into another category. Blocks release.

- FUTURE: will be turned in to a TODO eventually, optional, often architectural

- MAYDO: nice to have, very optional

- PERF: do this if more performance is needed

+

some semantic tags related to domain

Opinion: TODOs are NOT code smells, they accrue around the most valuable parts of the codebase.

zahlman

I like these, although I wonder about the value of speculating about a performance optimization while neither just doing it nor profiling.

Nadya

Very useful for flagging any O(n^2) that make assumptions about the size of N because N is not expected to exceed a certain size. Especially for when N inevitably exceeds that size.

Documenting it saves the poor dev doing profiling in the future a bit of effort so they can come up with the better solution that you failed to come up with when writing the code.

Often times code has to be written and committed and I don't have the time nor the brains to come up with a novel solution that solves a future performance issue that is not yet and is not expected to ever become a performance issue.

sfink

It's just saving the next person the trouble of thinking up and documenting the same approach you thought of while writing the code in the first place. As in, you know it doesn't matter now because the overall thing is plenty fast enough, but you can imagine a future where performance starts showing up as an issue and you wnat to leave a breadcrumb saying "this fruit here, it's a-hangin'".

achenet

Personally I use

FIXME: something broken that needs fixing

TODO: potential features/improvements

WARN: noting complex edge cases/weird behaviors

Lammy

I think in these same three categories but label them TODO, T0DO, and TOD0, respectively. I like that they look roughly the same when visually scanning through a file but are easy to grep for separately.

GLdRH

I find it weird to use TODO for something you don't actually have to do. But you're apparently not the only one to do this, and as long as everyone who's working on the same code is on the same page it's fine I suppose.

ericbarrett

For me, XXX is a mental note to "fix this before your next pull request." If I'm being serious I'll set up CI to reject any code with a comment containing this string. So in that sense it would be the highest priority.

cjbgkagh

I do something similar, I place an assertion instead of FIXME for code paths that are not yet finished and can be avoided. My TODOs are associated with possible tasks including a refactor for performance or clarity. My NOTEs are for tracking historical information and to capture thinking at the time that would not be immediately obvious from looking at the code.

nonethewiser

Great in theory but these conventions are meaningless without tooling IMO. Assuming you are working in a team. Which is not to say they are meaningless - maybe there is or should be tooling for this.

johnmaguire

This is pretty much what I do too. `XXX` is "Look here! This is important!" or "You might not expect this!"

I rarely use NOTE, but I have on occasion.

jackpirate

What's the origin of XXX? I've seen FIXME/NOTE/TODO all over the place, but never encountered XXX before.

slongfield

It has some ancient history as a morse code distress signal: https://regulatorylibrary.caa.co.uk/923-2012/Content/Regs/03...

And it shows up in some old BSD code: https://www.snellman.net/blog/archive/2017-04-17-xxx-fixme/

But... I think repeated letters are just easier to type than any other string, and since X looks like the classic "marks the spot" logo, it's what people jump to.

1659447091

I always thought it was from Java, but that's probably a personal bias; I am sure it was used long before Java was a thing. I did find this though (archived from 1999):

https://www.oracle.com/java/technologies/javase/codeconventi...

zahlman

Unclear, but we do have https://www.catb.org/jargon/html/X/XXX.html

> Some hackers liken ‘XXX’ to the notional heavy-porn movie rating.

This seems plausible given the older culture ("this is metaphorically dirty, and therefore like porn", insert puerile snickering) and I can recall old jokes about "searching for" these markings. But I think it's also just about it visually standing out - the X character filling the terminal display cell with sharp lines.

pisipisipisi

Amsterdam.

jansan

I have often thought about doing exactly this, but one thing that always made me hesitate was the fact that nobody else seems to be doing it. Now that I finally see that others are actually using other labels than TODO I may actually start doing this, too.

kentonv

This is a style issue. Different people can have different definitions and cultures around TODOs.

My codebases tend to use TODO exactly as described here. A TODO is really just a comment documenting the implementation -- specifically, documenting something that is missing, but could be useful. It doesn't mean it actually needs to be done.

IMO it doesn't make sense to use comments in the codebase itself as an actual task list, because priorities are constantly changing. Things that seemed important when you wrote the code may turn out not to be, and things that you didn't think of when writing turn out to be needed. Are you constantly submitting PRs just to update the TODO comments to reflect current thinking? I mean, sure, I guess you could do that, but I think it makes more sense to maintain that list in a bug tracker or even just a text document that can be updated with less overhead.

mcntsh

To me this brings the phrase to mind: "perfect is the enemy of the good."

Ideally tech debt or code-smell encountered like this would be captured/tracked/described better but often-times this means context switching or engaging in some kind of high-friction activity (like filling out a JIRA ticket) and that just discourages tracking it at all. At least inline TODOs are captured somewhere. And they can be for doing.

iotku

I'm sure in larger codebases it can get unwieldy with tons of TODOs from a lot of different people, but for personal projects I've always found them a good compromise.

For me it's saying "yeah I know it could be better but I'm not going to break my train of thought over this and context switch. It's not so critical as to break functionality, this would just be nicer."

I really do appreciate TODO hilighting in editors for the odd occasion where I get back to something on a whim and feel like doing a quick fix then. (It's probably not realistically that common though and most will sit there indefinitely)

dijit

I really appreciate the feature of Jetbrains IDEs whereby the codebase is indexed for TODO comments.

I often find myself with some time on a plane and cracking open my laptop to dig through to the TODOs that are shown is really cathartic.

nonethewiser

I think the main thing is sometimes you want the signal that there is work to be done in the code. In that case even if you track it on JIRA, GH issues etc. you'd still want to link it. And a reference is a bet on continuity so without a description in the comment as well you might lose the meaning someday.

sublinear

Put it in your git commit message.

Most commits people make are rather bad. Instead of taking us back to the stone age with TODOs, why not encourage better tool usage? Many don't commit often enough and instead tangle together unrelated changes. The cherry on top is when the commit message is just "updating somefile.py" or something similarly unhelpful.

mcntsh

How would that be discovered? If I inline a TODO comment calling out some tech-debt that I (we, our team) had to take on, then in the future when the next person touches that logic they will see that comment and might address it. If it's in a commit message it might as well be invisible.

sublinear

Discovered by other devs? git blame.

Discovered by the rest of your org? I don't see how a TODO in the code is more visible than a git commit message. In fact, at least it's possible that non-devs may still be able to see the git commit messages in a feed or have read access to repos.

inetknght

> Put it in your git commit message.

Yes, that's fine. Developers can also put TODOs in their git commit message.

> Most commits people make are rather bad. Instead of taking us back to the stone age with TODOs, why not encourage better tool usage?

I have a tool which fails if it finds a TODO in a comment without a Jira link on the same line. Since it fails if it finds such things, it's great for CI/CD piplines to block PRs until all of the oddball ends have been tied up and made visible to the product team.

Alas, if we could get the product team to prioritize those TODOs then they can start to be removed from the codebase...

dietr1ch

I'd rather see a TODO in the source file than in the commit message because of discoverability issues with commit messages.

Maybe that can be fixed? If I need to git blame the right line, and while ignoring miscellaneous commits like formatting changes, renames, and additional comment additions, then I'm probably not going to find the commit message. Also, if you do all of that just to find a vague commit message, then why bother digging next time?

Best tech-debt tracking I've seen is in the form of TODOs with mandatory links to the issue tracker (thanks to a silly regex pre-commit/pre-submit check) coupled with a team culture of adding such TODOs, as just adding the regex check will just cause lazy and sloppy engineers to not add a TODO at all, especially when facing pressure from other teams.

sublinear

Maybe this is what you're thinking of?

git log -pM --follow --stat -- path/to/your/file

This will get you all the changes a file has gone through. You can also add --ignore-all-space if that's a problem.

null

[deleted]

bcrosby95

Most commit messages are bad, but commit messages are a terrible TODO list.

sublinear

You're right they are a terrible TODO list, but old comments in the code are worse because you don't have as much context to work with.

bitwize

There are readily available MCP servers for JIRA that let the AI fill out the tickets for you, right from inside Cursor.

0x457

Interesting, yesterday I was looking at the source code of some library, and noticed a lot TODOs scattered all over. At first, I thought it's a red flag and I shouldn't use this library.

However, once I read them all of them, were exactly this: very rare edge cases, minor optimizations, and notes about future optimizations possible optimizations.

I pretty much immediately adopted this style of todos.

happytoexplain

Agreed - there needs to be a space for known issues that are not worth tracking. Issues that need to be understood as real, but perhaps may never be viable to fix. Something you can ctrl-F for when you have time and are curious if there's something you can clean up.

It drives me insane that so many tools/processes treat TODOs as essentially code smells.

skydhash

I still have to come across one of those issues. It may not be a priority, but it is a broken window (Pragmatic Programmer book). If it’s a won’t fix type of issue, just add it to the software docs.

basfo

The example in the article:

> // TODO: If the user triple-clicks this button, the click handler errors because [xyz]

looks more like a comment than a real TODO to me. I agree that comments like those are useful, but shouldn't be a TODO.

A TODO implies a specific type of comment. One that implies a task, points to something that should actually be done (like TODO: This function should return another value with XYZ). And I agree that the proper place for that is a tracker, not buried in the code.

In the example just documents a bug. , there is no actual action.

In my experience, TODOs are often a way to get quick and dirty code approved in a PR. They usually never get done, they're just a way to push the responsibility onto some future developer who "will have more time" (which means it will likely never happen).

sophiebits

Comments are usually for explaining why code is doing what it’s doing. If you write just

// If the user triple-clicks this button, the click handler errors because [xyz]

then it’s less clear at a glance that this behavior is undesirable. Is this a bug, or is it supposed to be this way? “TODO” is a quick marker that (to me) means “here’s something that is not ideal and may be worth keeping in mind if you are working on this code”.

If you or your reviewers know that it’s not OK for the fix to never be implemented, then of course, track it somewhere where it will get done. My experience is that discouraging TODO comments leads to less-documented code, not better code.

kstrauser

I think that's a case for "NOTE", which has the semantics of "this is something unusual and significant to pay attention to".

Edit: BTW, my specific disagreement is with using "TODO" to mean different things. I'm otherwise completely on board with the kinds of comments you're asking people to write, even if I'd label them differently. When I'm trying to understand new code, much of the effort is in trying to figure out why the author chose the approach they did. Why'd they do this instead of the more usual approach? Did they understand the tradeoffs, or just find things on Stack Overflow or ChatGPT? Did they take this edge case into consideration? Seeing their thinking is vastly more useful than

  // Add two numbers
  three = one + two

SoftTalker

I dislike that as an example of a "good" TODO comment because for the same effort as writing that comment you could just fix the issue, or at least make it do something that isn't an error (and then maybe leave a comment such as "triple-clicks ignored because [xyz]).

You've already gone to the effort of determining the trigger and the reasons for the error, so you're probably 80% there.

muzani

It's a skip. Most are fine even if they never get done. What's not fine is when code is not fully functioning and we assume it is.

My favorite TODO was something like class EncryptedSharedPreferences with a "TODO: encrypt this". It was written by someone who left before I joined (I never would have approved it lol). But it made it clear that this code was indeed, unencrypted, instead of having to figure out whether it was encrypted by some other module or worrying that we'd encrypt it twice.

zahlman

Surely it's the data that needed to be encrypted?

GLdRH

No, the comment.

dgunay

I think there are lots of valid ways of using TODO comments.

In my org, TODO comments trigger the linter, so they usually have to be addressed, downgraded to a regular comment, or turned into a ticket. They're a nice way for me to mark places I need to remember to come back to before I put something up for review.

I sympathize heavily with the viewpoint that pushing these things into ticketing systems means they're less likely to get done. I think it's nearly impossible to lobby for TODO: comments to get done against a never ending stream of ultra important high business value work. Leaving these concerns inside of the codebase itself is one way that programmers can take back control when technical concerns and code quality are dismissed or deprioritized constantly.

Arainach

Hard disagree. If you're not going to file a bug or ever do it, don't write TODO

// TODO: If the user triple-clicks this button, the click handler errors because [xyz]

This is documenting what currently happens. It's not TODO, and that word shouldn't be in the comment.

allthedatas

I also use a tiered strategy and FIXME for things that really need to be fixed or I have a solid idea what the next step would be to fixing it.

TODOs are something less solid than a FIXME and are also just about getting it out of your head so you can devote more mental energy to something else or just relax.

Maybe the idea is not fully formed yet, maybe you are not sure you really want to do it, maybe it is waiting on something else, but it needs to be captured or you will have to keep thinking about it lest you forget.

As soon as I write down a TODO (code or other) that was only in my head, I can relax a little more, because now it's captured for future reference.

ngruhn

Strongly agree. I think of TODO as a task that might be interesting for the next person who stumbles over this code. "This logic is not great. If you happen to refactor this entire feature consider changing this thing as well". The TODO can even have an associated ticket but because it's right in the code it's more discoverable. Otherwise, the next person to change the code might even complete the ticket without knowing it.

paulddraper

"Ideally, this code would X. It's acceptable that it doesn't, but if you do change it, considering doing this differently."

luckydata

then it's not a TODO, it's just part of the comments. Promoting semantic diffusion IMHO is not a good practice in software development.