views:

585

answers:

13

For many years my code was full of this kind of comments :

//TODO : Add ...
...
/*
 *TODO : Fix ...
 *
 */

Now I think to create my own @todo javadoc annotation ... but before doing that I want to know if do you guys have better way to manage your todo programming stuff ?

+2  A: 

For small tasks such as my usual //todo I use local tasks in Eclipse Mylyn, for bigger tasks (even if I think those might be called features or bugs) I use Trac; if you find your code full of TODOs it's time to get a ticket management system.

Alberto Zaccagni
+18  A: 

Your IDE (Eclipse, NetBeans, ..) has a tasks plugin, which detects all TODOs and shows them in a list. In Eclipse it's Window > Show View > Other > Tasks

No need to write your own annotation.

Bozho
+4  A: 

For vim there is also this Tasklist script, inspired by Eclipse's task list, which scrapes for TODO, FIXME, etc. in your text files and displays them as a list in an extra buffer (see screenshot).

catchmeifyoutry
I didn't know this existed. Thanks!
Jason Down
+7  A: 

I basically use three systems for different kinds of TODO items:

  • Paper notepad for short-term items (like today or this week)
  • TODO comments plus IDE support (e.g. Eclipse Tasks view) for smaller, longer-term items
  • Issue tracker like Trac plus IDE support (e.g Mylyn) for more complex, longer-term items
Fabian Steeg
+1 for the issue tracker (and the paper!)
Brian Agnew
+1  A: 

Maybe you can use find and grep to search for those keywords in your projects

ZelluX
+2  A: 

problem with todo flags is the same as with warnings (e.g. java compiler, checkstyle). if they appear to often, you will ignore them. in your case i would track them through a report by a build-system (e.g. maven or ant). at the end of each iteration you should make a rule, that the number of todo flags decreases.

less todo-flags means:

  • solving them
  • delete them because they got obsolete (which happens often if you never tidy up code)

generally don't use todo flags for all tasks. for me they are just little reminders or refactorings-todos. bigger tasks should always be tracked by a ticket-system (like trac or jira).

manuel aldana
We used a plug-in for Hudson that showed the TODOs over time - it's public and visible, meaning there's more drive to reduce it over time.
hbunny
+2  A: 

Maybe Doxygen can help you?

Doxygen recognise those ///@TODO:s and creates a list with them.

And since Doxygen can use Javadoc style comments, I guess it is kind of easy to try it.

Johan
+1  A: 

If your TODO statements are bugging you that much and causing you that much angst when seeing them I'd write a small script in the build process that detects and fails the compilation. Have it fail in the same way that it fails on warning statements.

wheaties
+1  A: 

I use FIX! instead of TODO. The number of exclamation points indicates the priority. IntelliJ lets you set up custom filters for these, so I can look at level-3 "FIX!!!" comments and tackle those.

Sam Barnum
+1  A: 

I would not use a @todo javadoc annotation because IMO it should'nt go into the documentation.
Documentation should be public, not ideal for TODOs.
TODOs should also go near the code they relate to, an advantage of using comments.

Carlos Heuberger
+2  A: 

If you are using Maven, you could use the taglist-maven-plugin to scans the source files for tags (any tag you want, this is configurable) and generates a report on their occurrences.

The Taglist Maven Plugin generates a report on various tags found in the code, like @todo or //TODO tags

But tracking tags is the easy part, fixing them is a bit harder and takes more time :)

Pascal Thivent
+1 : I just sow a sample report : really interesting !!
wj
+1  A: 

TODO statements carry the risk of being left in the code forever, which is bad because // TODO elaborate answer

Daniel Daranas
A: 

TODO is fine in a small team, but if you open-source project or widen the developer access in any way, the other variants like TO_DO, fixme, XXX, NOTE, HACK, bug, "your_defect_tool_here" and so on need scanning for anyway. A bit heavyweight, but my TODO protocol would look like:

TODO:yy-mm-dd:author:your_comment

Lastly make the comment you do leave strategic, not a design statement or opinion.

Conrad B