So I only recently discovered the TODO comment. For those of you that don't know, most modern IDE's will recognize this word in a comment and flag the comment line a different colour so It stands out.
EG.
//Need to talk to Bill about refactoring this code //TODO:Need to talk to Bill about refactoring this code
You may notice in IDE's like Eclipse or Rubymine highlight the TODO comment and some nice other features to do with it.
My question is: What other keywords are there like the TODO? It seems like a much better way of communicating to developers through comments and a feature that should be a bit more widely known in IDE's. Their purpose is to help with development after all..
In general, a TODO is written to tell future maintainers about something important: something that should be added, or should be changed, or should not be forgotten. The intention is often to increase the quality of the code. Sometimes a TODO comment can save you a lot of time!
Single-line comments start with two forward slashes ( // ). Any text between // and the end of the line is ignored by Java (will not be executed).
To create a TODO commentPlace the caret where you want to create a TODO item and add a comment, for example, by pressing Ctrl+/ , then type TODO or FIXME , and then type your note. View the list of TODO items in the TODO tool window.
In the Settings/Preferences dialog ( Ctrl+Alt+S ), select Editor | TODO. Use a regular expression to specify a custom pattern. This matches the word "optimize" ( \b designates word boundaries) and allows any number of other characters in the comment. Then click OK to save the new pattern.
I can speak of Eclipse, you can customize it.
Click on Window -> Preferences, and search for General -> Editors -> Structured Text Editors -> Task tags, or for Java -> Compiler -> Task tags (there might be some additional ones like for JavaScript, PHP, StatET, etc.)
TODO, FIXME, XXX
I use some additional ones like:
CHECKME, DOCME, TESTME, PENDING
I personally like to use the DISCUSS
/REVIEW
tags just to make sure I speak about some issue with someone during a code review or pair programming (e.g., I haven't misunderstood the specification how something should work etc.).
You can also set the priorities assigned to the different task tags there too.
These are known as task tags
. In Eclipse they are TODO
, FIXME
, and XXX
.
However, Eclipse allows you to modify the available list of task tags. Go to preferences
> Java
> Compiler
> Task Tags
Here you can modify the available list of task tags, change their priority, and decide if task tags should be case sensitive or not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With