I'm doing the same. When there is something "to-do" in my code, I write //TODO .... But I'm curious to know when this started and if there is a reason for writing "to-dos" in all capital letters?
|
|
||||
| show 1 more comment |
closed as not constructive by ChrisF♦ Jun 11 '12 at 10:11
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.
|
Also, it's great to have a way to easily search for code sections you glossed over and want to get back to. You can do a case-sensitive search for "TODO" to immediately find what you skipped before. "todo" (lower-case) could potentially be part of a larger word/function/variable, but "TODO" (upper-case) is probably not going to be. |
|||||||||||||||||||
|
The idea with comments like TODO and FIXME is to make them stick out. You generally don't want to ship code that has such markers in the code -- they mark things to be done before the project can be considered complete. Using ALL CAPS makes them a little easier to spot, provided you don't use ALL CAPS for a lot of other things in your code too. |
|||
|
|
|
Both Eclipse and Visual Studio have Task List features that automatically give you lists of comment lines that have TODO in them. |
|||||
|
|
I just stands out and is easy to catch... nothing complicated! |
|||
|
It calls attention to the fact that there exists a todo. It is important that it be obvious all the time that someone needs to come back to the code. The particulars only need to be known by the person coming back to address whatever the issue is. |
|||
|
|
|
If you are a vi user use:
It will get you there very fast. |
|||||||||
|
|
Some editors only highlight uppercase TODO items, so it's safer to always use uppercase. |
|||
|
|
|
Visually ALL CAPS stands out, but isn't very legible. When reading code they scan as a block of a particular size. It doesn't really matter what the letters are. They just stand out and can be seen very quickly. Once you have been working with the tags for a while, your brain will recognize the word by shape. From a tools (IDE/Editor) standpoint, case sensitive search will have a very low false positive rate on all caps versions. In some coding styles there is a small risk that a constant will be matched. Case sensitive whole word search makes false positives even less likely. Once the tool gets it on screen the format clearly says look HERE. Once you are focused on the location, the legible part will be the related comment. |
|||
|
|

//todo:...– BЈовић Dec 24 '11 at 13:18