Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does the TODO convention come from?

I suspect this question has been asked before, but it's not easy to Google for.

I am a fairly new coder and I see a lot of code, in a lot of different languages, with comments beginning "TODO".

Questions:

  • Is there a practical reason why people write TODO in all these different languages, or is it merely a convention?
  • If the latter, where did the convention come from?

I can see why it's useful to be able to grep for TODO, I'm just curious about the history behind it.

like image 294
Richard Avatar asked Feb 29 '12 12:02

Richard


4 Answers

Programming is a world-wide activity; conventions to help smooth the process of working with people who are not native speakers of each other's languages are worth their weight in gold. TODO, XXX and FIXME are often highlighted by IDEs, which provides an excellent incentive to stick with these options.

  • XXX suggests a danger or hazard that maintenance programmers must be aware of;
  • FIXME insinuates that something is wrong with some implentation which needs to be changes;
  • TODO explains shortcomings that would be nice to address.
like image 171
sarnold Avatar answered Nov 20 '22 06:11

sarnold


In addition to the comments about grepping, editor/IDE identification etc. I would think that a big reason as to why TODO became the standard, instead of say todo or ToDo, is simply that TODO is a big todo.

like image 38
JPI93 Avatar answered Sep 22 '22 12:09

JPI93


TODO means "to do". Something that someone will need to do. Just guessing, but could this guess be wrong?

like image 4
Jarekczek Avatar answered Nov 20 '22 08:11

Jarekczek


Just a quick follow up to the original answer: This feature is mainly a reference and you'll find it in Frameworks if there are items that aren't detrimental to the code still running, but that the developers would like to address.

The nice thing about modern IDE's, for example I use JetBrains PHPStorm, they actually highlifht TODOs and place them into a Toolbar for your entire project so you can see all the TODOs for all your files differentiated by their directory and file name.

Anyway, just thought this may add further light as to why you may see it throughout code.

like image 1
John Avatar answered Nov 20 '22 07:11

John