DEV Community

Jonathan Hall
Jonathan Hall

Posted on • Originally published at jhall.io on

TODO: Add an intriguing title

TODO comments.

Ya love ‘em or ya hate ‘em.

But why are they there?

I think there are broadly two categories of TODO comments:

  1. Something that needs to be investigated
  2. Something you know should be done differently, but you don’t want to take the time right now
  3. Ideas for future improvement

The TODO comment stands in as a little bookmark saying “Get back to me and make this decision or do this refactor some day!”

The trouble is… they almost never actually happen. Don’t believe me? Try this little trick on any code base with TODO comments, which will show you the last modified date of every TODO comment in your code base.

git grep -n TODO | while IFS=: read i j k; do git blame -L $j,$j $i | cat; done

Enter fullscreen mode Exit fullscreen mode

If you actively use TODO comments, and you have zero TODOs, or the oldest is not more than a couple weeks old, I want to hear your secret!

So here’s my challenge to you:

Stop creating TODO comments!

Instead, do one of three things:

  1. Investigate or fix the thing right now. If it’s important, this is the best option.
  2. Simply don’t do the thing. If it’s not important, this is the best option.
  3. In the truly exceptional cases where something is important, but cannot be done immediately, track it in your issue tracker, not in a TODO comment. That is, after all, what an issue tracker is for, right?

If you enjoyed this message, subscribe to The Daily Commit to get future messages to your inbox.

Hot sauce if you're wrong - web dev trivia for staff engineers

Hot sauce if you're wrong · web dev trivia for staff engineers (Chris vs Jeremy, Leet Heat S1.E4)

  • Shipping Fast: Test your knowledge of deployment strategies and techniques
  • Authentication: Prove you know your OAuth from your JWT
  • CSS: Demonstrate your styling expertise under pressure
  • Acronyms: Decode the alphabet soup of web development
  • Accessibility: Show your commitment to building for everyone

Contestants must answer rapid-fire questions across the full stack of modern web development. Get it right, earn points. Get it wrong? The spice level goes up!

Watch Video 🌶️🔥

Top comments (0)

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

👋 Kindness is contagious

DEV is better (more customized, reading settings like dark mode etc) when you're signed in!

Okay