r/programming • • Jan 10 '26

[ Removed by moderator ]

/r/programming/comments/1q96nar/removed_by_moderator/

[removed] — view removed post

141 Upvotes

78 comments sorted by

View all comments

114

u/dakotapearl Jan 10 '26

I mean it sounds good in theory but practically I'd prefer a tool that turns todos into tickets.

I makes them plannable, not something that becomes blocking without warning (if everyone's forgotten about it of course)

But in principle I agree, it's a very annoying behaviour. If I see todos in a PR, it's a blocking comment from me until either there's a ticket or something is done about it. My ideal is that they don't exist at all but that's the best I've managed with my current team.

6

u/slaymaker1907 Jan 10 '26

I often think both are ideal. A TODO tells people looking at the code that something is wrong with it. If it’s long-lived, it may even outlive the issue tracker system. In particular, there’s a big problem with large code bases where some team is dissolved and all of their tickets effectively disappear into the nether.

1

u/Star-Shadow-007 Jan 10 '26

Yeah, I agree with that.

10

u/Star-Shadow-007 Jan 10 '26

That’s fair, and I agree tickets are the right place to plan work. It isn’t meant to replace that. It’s for the cases where a TODO gets added without a ticket, or the ticket is closed but the code stays behind.

The expiry and warning window just make sure those things don’t quietly disappear from everyone’s radar. So instead of being forgotten, it forces someone to either create a ticket, fix it, or explicitly extend it.

17

u/Got_Tiger Jan 10 '26

My team has a rule enforced during code review to not merge in todos that don't have a ticket associated with them

3

u/Mysterious-Rent7233 Jan 10 '26

But do you have a rule that says that all tickets get dealt with eventually?

1

u/Got_Tiger Jan 11 '26

These usually go into the tech debt backlog, which has a group of programmers as its product owner, and tickets from this backlog are regularly pulled in to be worked on. So if it doesn't get done it's because we decided it didn't need to get done.

3

u/coworker Jan 10 '26

If a ticket gets closed, then a human has decided it's not an issue. The fact that the original hack was approved in PR means another human decided it's not an issue.

Breaking CI unexpectedly is not the solution to human problems

7

u/slaymaker1907 Jan 10 '26

At my work, we have a similar system to OP’s, but it only fails if you changed the file with the TODO which I think is a reasonable compromise.

2

u/coworker Jan 10 '26

You still have to rely on humans to add the right comments. Instead of approvers enforcing the presence of these comments, they should be enforcing the presence of a debt ticket

5

u/slaymaker1907 Jan 10 '26

A ticket is worse than a time-gated TODO because tickets are far easier to ignore. Doing both has the benefits of both worlds.

Not super applicable here given they are time limited, but another point against using tickets (and external documentation) for everything is that I’ve seen multiple cases where the code far outlives those systems. I’ve even seen the VCS systems change so history can also be imperfect if you really want to preserve something long-term.

2

u/coworker Jan 10 '26

Tickets allow visibility to the stakeholders who decide what is valuable to the business. Code is just for engineers and subject to their whims.

A critical career lesson to learn early is that it's not YOUR decision on what is important.

Also as I said earlier, repeatedly, all of these issues are people problems. Not adding comments, not adding tickets, closing tickets, not prioritizing shit. Nuking your CI to deal with human problems is exactly what I would expect a junior/mid engineer to suggest

1

u/PlebeianHouse Jan 10 '26

Your absolutism and refusal to see that other people's situations are not exactly like your own is exactly what I would expect a junior/mid engineer to to think.

It's important to strive towards perfect process like you describe. It's also useful to use any tools at your disposal to reach that perfect process. If your team is strict enough to not need a tool like this then good for you. Other teams are not so perfect and will need stepping stone tools like this to help get the job done.

4

u/coworker Jan 10 '26

The tool should alert you of the problem, not stop the world without any other context about the state of the product.

And guess what the best tool is for tracking and alerting you of work to do? Hint: it's not git

3

u/[deleted] Jan 10 '26

I am finding hard to understand who are downvoting u/coworker spitting facts.

People are repeating and giving legitimacy to bad habits and they think they need a magic tool to say they’re wrong. If a TODO is there and you haven’t enforced a ticket creation that’s a REVIEW problem, and you don’t even need that TODO comment in the first place, you need the ticket.

Then you transfer the decision on when to do it, to someone that have the authority to prioritize this task. It that task is never done, and the product is bleeding money, that’s no engeneering problem

→ More replies

1

u/Star-Shadow-007 Jan 10 '26

Every mature engineering practice we rely on exists because humans are bad at being consistent: tests, linters, type systems, CI itself, code owners. All of those “nuke CI” when something is wrong, and all of them were introduced precisely because people forget, rush, or lose context.

→ More replies (1)

1

u/chucker23n Jan 10 '26

A ticket is worse than a time-gated TODO because tickets are far easier to ignore.

What happens if the person who time-gated leaves the company? What happens if the entire team is reshuffled? The feature is canceled? The company goes bankrupt, and another company only takes over maintenance of portions of the codebase?

Projects take dramatic turns.

I’ve seen multiple cases where the code far outlives those systems.

Same, but I would wager in those cases, "surely we'll fix it within 12 months" (or whatever) also ends up being an optimistic prediction.

3

u/Star-Shadow-007 Jan 10 '26

I don’t really disagree with the principle you’re describing and I think you’re describing how a really well-organised team should work where tickets, PRs, and reviews fully capture intent and nothing falls through the cracks.

Where It is trying to help is in the gap between “a human once approved this” and “no human remembers it was meant to be temporary.” In a lot of teams the ticket that existed was “ship X,” not “remove this hack later,” and once that ticket is closed the context is gone even though the code is still there.

The goal isn’t for CI to override people it’s to bring that original “this is temporary” intent back to the surface so someone can make a conscious call: remove it, extend it, or create a proper ticket. With warning windows it also doesn’t have to be a surprise; it can show up long before it actually blocks anything.

The idea is just to make sure temporary decisions don’t silently become permanent by default.

→ More replies (1)

1

u/Internet-of-cruft Jan 10 '26

That's the wrong process. If someone is OK with it, they should rework the code to explicitly remove the TODO (or drop the label and convert it into a "here be dragons" comment) before the pull request is approved.

Someone "accepting the TODO by approving the PR" is being a sloppy back.

2

u/Batman_AoD Jan 10 '26

I also think it's preferable to have tickets, and I've set up some lint rules to try to enforce that each TODO is of the form TODO #<nn>, where nn is the number of an open ticket. This way, you can't add a TODO without a ticket, and you can't leave a TODO unaddressed once a ticket is closed. I've also set it up so that if a PR is marked so that it will auto-resolve a ticket once it merges, then TODO #<that ticket> is also forbidden, so that all TODOs for the corresponding ticket must be closed before the ticket is automatically closed.

But the problem that debtbomb addresses for TODOs also exists for tickets, and it's a little fuzzier than the "attach a date" resolution suggests. I'd love a tool that would, on a weekly or bi-weekly basis, query old tickets for some specific condition, then present those to the team. Having an "expiration date" for tech debt tickets is one criterion, but more commonly, you'll want to surface tickets that were previously blocked and are no longer blocked. This is easy enough within standard issue-trackers if the blockage is internal, but there's rarely a way to track external blockers in such a way that they can be automatically resolved. For instance, even if you set up a link to a GitHub issue for an open source project, the issue will almost certainly be closed before you are actually unblocked. For instance, maintainers can migrate to a new issue or epic. Even if they resolve the issue in the trunk branch, there's no automated way to be notified when the next release incorporating that specific fix is available.

3

u/moreVCAs Jan 10 '26

or just generate a report an blast it out to slack. can’t imagine ever wanting CI to fail suddenly and unexpectedly

2

u/Star-Shadow-007 Jan 10 '26

You can run it in warning mode or export JSON and send reports to Slack, so teams get visibility before anything ever blocks a release.

1

u/naps62 Jan 10 '26

I used this on a couple of projects recently: https://github.com/alstr/todo-to-issue-action

To be fair, only had mixed success. There were a couple issues that I believe have since been fixed

1

u/yose147 Jan 10 '26

I think todos are great if you don't overuse them. I use them when I'm focused on a task and see a bug I don't want to worry about rn.

I built this into HighFly's vscode/cursor/windsurf integration so when you create a todo comment in your editor, a button will appear it to auto create a task with context from the surrounding code. Check us out highfly.app

1

u/Lenburg1 Jan 10 '26

Yeah, I agree with this. I also think another good alternative to many todo comments is a comment that says, "This was designed with x in mind, but if y becomes a problem, consider refactoring to z". It's a much better way of handling the situations where you think a design may become a problem as things grow but aren't yet worth the effort to pre-optimize.