The Eclipse IDE has built in what they call task tags. These are little tags in the comments that indicate that something needs to still be done. An example of this is the popular TODO tag. I see a lot of people using this tag, and sometimes, even IDEs add them in for you.
Eclipse has three task tags built in by default. A TODO tag, a FIXME tag, and an XXX tag. When you see a TODO tag in a comment, you know that something still needs to be done. The FIXME tag is a more serious problem that should be addressed right away. The XXX tag–well who knows what it means, but I think somebody failed to think about the name they are using.
Even though Eclipse defines several task tags for you, you can use whatever task tags you want.
There are several that I find very useful:
- TODO: Marks something that still needs to be done. Lots of people use this.
- TRICKY: Marks a section of code as a tricky part of the code. When you come back to the code, you will quickly see that you don’t want to mess with the code unless you know what you are doing, or you could mess things up pretty badly.
- HACK: Marks a section of code as being a hack. Though everyone tries to aways write perfect code, sometimes we end up hacking things together to meet a deadline, or simply because it is easier. We then go on with our lives and the hack remains in there forever. Marking these sections as a hack makes it obvious that there is a better way. In fact, whenever I put in a HACK tag, I try to also include what I would have done had I had more time to work on it, so that the ideal solution is clearly marked.
- BUG: This is maybe similar to the FIXME tag built into Eclipse. I put these in my comments if there is a bug that I know about in it. Obviously, these should have a high priority for fixing, because they’re a known bug. For various reasons though, sometimes they don’t get fixed for a long time. Perhaps it is a bug that is rare to see in normal use of the program. When a developer does finally get around to fixing the bug, if there is a BUG tag there to indicate what might be going on, it helps them quickly get up to speed with potential problems with the function. Of course, good unit tests will keep these kinds of bugs in check.
Perhaps you have your own that you use. Please share your ideas in the comments!
View Comments
blog comments powered by