DEV Community

TODO or not TODO / Stop spamming the code with useless comments

Julia Shevchenko on August 25, 2025

It has been proven that the best way to solve a complex task is to divide it into smaller tasks. Some people create a to-do list in a notebook, som...
Collapse
 
best_codes profile image
Best Codes

I use TODO comments all the time in my own code, but try to never use them in PRs. Even in my own code, I always give a lot of details in the TODO comment so that I'll remember what was going on if I stop working on the project for a while and then come back.

Collapse
 
dasfluchen profile image
DasFluchen

Me too, with TODOs. There are definitely wrong ways/times to use them, like in the author's example, but when used as intended(IMO), they are valued approach. For example ...
-In HTML .. TODO: add disable or required back in input tag
-SS Scripting .. TODO: Add server side validation of query params
If you're leaving TODOs in your source code, YOU'RE NOT DONE!

Also, you'll need an IDE or editor with a TODO lister to make it much much easier to manage!

Collapse
 
juliashevchenko profile image
Julia Shevchenko

Exactly! The point is to leave some notes to yourself and complete them shortly, not to leave them forever.

Collapse
 
juliashevchenko profile image
Julia Shevchenko

Thanks for sharing! It's an example of a proper usage, which adds clearness, not mess.

Collapse
 
chanhlt profile image
Chanh Le

Yes, a PR should not be merged if it has any TODOs remains.

Collapse
 
georgekobaidze profile image
Giorgi Kobaidze

Comments are such a controversial topic. In fact, they exist for a very good reason, and you've actually demonstrated how a developer can use them for benefit rather than making life more complicated than it already is.

They're controversial for one reason, so many people use them incorrectly. It goes way back to writing good documentation. Code comments are nothing but docs (well, sort of), and most developers aren't great document writers. I've seen brilliant coders who can't even put words together to write a solid commit message. This is a separate skill, but definitely a very much desired one.

I won't play a saint - I'm guilty of having a bunch of TODOs in my code (I've even embarrassingly used them in one of my articles here, thinking it would be cool, but it's really uncool. A good reminder BTW, I'll delete them😄). I only use them in my personal projects. When I work with a team, I never commit code that has nonsensical comments - I don't want someone to look at my code and think I'm lazy, selfish, or don't care about others. It's a bad place to be in.

By the way, your approach is really interesting, I mean specifying your name in a TODO comment. But that can only work well if you have some sort of team convention for writing TODOs like that. If a new developer joins and sees it, it could be confusing, because it's a very specific approach that's not used universally.

Also, since you're a .NET developer, which IDE do you use, Rider or Visual Studio? And how do you create a custom filter for you comments? Is there some specific approach or you just search it through the solution?

Great post! Thanks for sharing, and congrats on being in the TOP 7! Well-deserved! 🔝

Collapse
 
juliashevchenko profile image
Julia Shevchenko

Thank you!

It is indeed controversial. And like anything, it can be used for good in a reasonable amount.
And I agree, documenting is a separate skill. Nowadays, development is not only about writing code, but also requires a lot of other skills, especially communication.

As for named TODOs, I'm using them while I'm working on a task, usually something solid, not committing them. That's just for me to easily navigate among others' TODOs in the codebase.

I'm using Rider. To me, JetBrains' IDEs are the most convenient and support a lot of handy features. There is a TODOs view where you can add your custom filter using a pattern. By the way, it could not only be a todo, but anything.

Collapse
 
georgekobaidze profile image
Giorgi Kobaidze • Edited

That’s an interesting approach I haven’t tried it yet, TBH.

And yes, Rider is definitely superior, especially when working with macOS. I use it as well, though always with the dark theme, my eyes can’t handle too bright lights. 😄

Thread Thread
 
juliashevchenko profile image
Julia Shevchenko

That's another controversial topic 😄
I keep the monitor brightness at 45% + blue light filter, so it doesn't hurt eyes and any light themes or just ordinary websites feel nice and readable. But that's a matter of taste.

Collapse
 
kc900201 profile image
KC

Very nice post to remind ourselves of utilizing the small details in our coding practice. Normally, I would put in a checklist below the to-do's to include specifications to remind myself why I put the to-do comment in the first place.

/***
* To-dos:
* [ ] Include test scripts
* [ ] Refactor the components in client rendering
* [ ] Add in linting...
*/
Enter fullscreen mode Exit fullscreen mode

This might look lengthy, but it keeps me to be productive and complete the requirements in the end.

Collapse
 
juliashevchenko profile image
Julia Shevchenko

It's totally right to use what works the best for you.

Collapse
 
fredbrooker_74 profile image
Fred Brooker

I was in a video chat with a developer claiming he's not using any comments in his code = the opposite extremist :)

Collapse
 
juliashevchenko profile image
Julia Shevchenko

I can understand him, I suppose he observed lots of unnecessary comments previously

Collapse
 
fredbrooker_74 profile image
Fred Brooker

he was coding without IDE 😕

just vim...

❗ comments are necessary for static analysis in PHP as the language is not static typed

Thread Thread
 
juliashevchenko profile image
Julia Shevchenko

PHP Doc blocks help a lot and save a lot of time, so it's not evem a subject of discussion.

Collapse
 
leo108 profile image
leo108

So I built a TODO-reminder tool and integrated it into projects' CI to help developers to remind their TODOs

Collapse
 
juliashevchenko profile image
Julia Shevchenko

Wow! Great approach!

Collapse
 
parag_nandy_roy profile image
Parag Nandy Roy

Love the push for meaningful TODOs...

Collapse
 
vernica_bastosvev_321d profile image
Verônica Bastos Vevê

Dfdmdrm