We Are Too Big for TODOs: Why Code Annotations Aren't Enough in Large Projects

September 30, 2024

Recently, I faced a challenge at work that underscored this issue. Our codebase had accumulated many FIXME and TODO annotations: 71 TODOs, to be exact. Many of these were outdated or lacked context, making them more of a hindrance than a help. We clearly needed a better system for managing technical debt and pending tasks.

The Limitations of Code Annotations in Large Teams

One of the primary issues with in-code annotations is their invisibility to non-developer stakeholders like Product Owners (POs) and Business Analysts (BAs). These annotations reside within the codebase and are inaccessible to those who help shape the project's direction. This disconnect means essential tasks might be overlooked in planning and prioritisation sessions, leading to technical debt accumulating unnoticed.

In a large codebase, annotations can be easily buried and forgotten. Developers might not revisit a particular file or module for months when the TODO or FIXME remains unaddressed. This delay can cause minor issues to escalate into significant problems, affecting the project's overall health.

Modern development teams often use robust project management tools to track tasks, bugs, and feature requests. Relying on code annotations bypasses these systems, creating parallel tracks of work that aren't integrated with the team's workflow. This misalignment can lead to confusion, duplicated efforts, or tasks slipping through the cracks.

Personal Coding Practices vs. Team Dynamics

When working on personal or small-scale projects, I've found value in using a variety of code annotations:

  • FIXME: This is for code that's broken and needs immediate attention.
  • TODO: For future enhancements, optimisations, or refactorings.
  • XXX: For areas that require more thought and might be problematic.
  • HACK: For temporary solutions that aren't ideal but work for now.
  • NOTE: This is for meta-comments or reminders that need out-of-code context.
  • DOCME: For sections that require documentation.

These annotations serve as quick reminders and help me navigate my code effectively. However, this approach relies on my personal oversight and the fact that I'm intimately familiar with every part of the project.

This method must scale better in a team setting, especially in large projects. Not every team member will understand the context behind each annotation; over time, the accumulation can lead to confusion rather than clarity.

A Better Approach: Leveraging Project Management Tools

I advocate for transitioning from in-code annotations to using dedicated project management tools to address these challenges. Here's how we can map standard annotations to more effective practices:

  • FIXME: Create a bug report in the tracking system. This ensures it's visible to the entire team and can be prioritised appropriately.
  • TODO: Add a task or user story to the backlog. This allows the PO to prioritise it based on the project's goals.
  • XXX, HACK, NOTE: Engage in discussions during refinement sessions or stand-ups. If the definition of ready isn't met, these concerns should be addressed before coding begins.

Formalising these tasks ensures they're visible to all stakeholders and integrated into the team's workflow. This approach promotes better communication, more accurate prioritisation, and a clearer understanding of the project's status.

As projects grow, so does the need for robust practices that scale with the team and codebase. While code annotations like TODO and FIXME have their place in smaller projects, relying on them in more extensive settings can lead to inefficiencies and miscommunication.

Transitioning to project management tools for tracking tasks and technical debt offers numerous benefits:

  • Enhanced Visibility: All team members and stakeholders can see, prioritise, and discuss tasks.
  • Better Organization: Tasks are tracked in a centralised location, reducing the risk of being forgotten.
  • Improved Collaboration: Teams can work together more effectively, with clear insights into what needs to be done.

In essence, we were too big to be using TODOs in the codebase. By adopting practices that align with our project's scale, we were able to manage our technical debt more effectively and keep our codebase healthier in the long run.