Search code examples
language-agnosticcoding-styledocumentationtags

Usage of HACK and UNDONE comment tags


Many software engineers are familiar with the usage of special comment “tags” that can be added to their code comments, for use in searches, automated task tracking, and so forth. Some of the most popular are FIXME, TODO, UNDONE, and HACK.

I'm a bit confused with the usage of HACK and UNDONE tags. Little help please?

Bonus points for showing the basic difference between FIXME and TODO


Solution

  • My understanding:

    • TODO: Something that needs to be done. This could be a feature to be added later, or indicating that something is a stub and needs to be implemented.

    • FIXME: A subclass of the TODO tag, indicating something is broken that needs to be fixed.

    • UNDONE: A note to indicate a change which was a rollback or reversal of some other change. This comment will usually indicate what was removed and why.

    • HACK: Something, usually an odd or unorthadox piece of code, which was added to fix some particular problem. These are usually not "elegant" solutions but nevertheless make the darn thing work. Often you will see these to address a bug in the framework or other unexpected behavior. Additionally, the purpose of the commented code will often be unclear were it not for the comment.