I think it was used more in days when we didn't have meta-comments - comments that ide is smart about now (FIXME is highlighted, indexed etc).
Novadays I'd use it in the code that really needs to be fixed because it smells. I wouldn't get offended when team member would say - don't use XXX, use FIXME or TODO only - because XXX'es shouldn't leak to commits anyway.
That's my opinion/gut feeling.
I do so because "NOTE" on it's own does not "scream loudly enough" to me when I read it, and as for "ATTN" I associate that with the writing on a letter when you want to send it to a specific person in an organization.
Here are a couple of examples from my own code:
https://github.com/eriknstr/TEMPer2-getdegs/blob/cfde4306623...
// XXX: Feels a bit stupid to check user_set_iterations each iteration.
https://github.com/eriknstr/klondike/blob/d33accd6965d8d2476... // XXX: https://bugs.chromium.org/p/chromium/issues/detail?id=615638
https://github.com/eriknstr/interweb/blob/6c2985f8d8a9d63d08... #
# Domain and records to update with the current WAN address of the router
#
# XXX: First record must expose origin server's IP address.
# This is by design because I need to be able to
# log onto my machine remotely using SSH
# so having a DNS name for the IP of the host
# makes more sense than not having it.
#
# If this is not acceptable to you, then this script
# is not suitable for your use-case.
# // XXX: There must be a cleaner way to implement this
or call on someone (most likely myself) to replace with a NOTE clarifying why an out of place snippet of code is needed or verify it came be removed completely // XXX: Is this check still relevant? # XXX FIXME - blows up if $x is negative
# XXX HACK - don't even ask
etc. etc. and then XXX on its own to mean "if you're skimming this code you really should read this comment but it doesn't fit a specific semantic category very well"I'm sure someone will point out that there are proper bookmarking commands in their favorite environment but I like not having to remember those, and this works in pretty much any editor/IDE.
And I'd agree: XXX deserves to be dropped due to lack of semantics.
Trying to figure out semantics for all those scenarios seems like a waste of brain cells - I'll stick to XXX since it is both grep-able and easy to see.
I'm a big believer in Developer autonomy - so I hope everybody can do whatever works for them.
In any case, I think XXX should be dropped in favor of prefixes with some semantic meaning.
I use XXX when there's no obvious tag. Some things require attention or consideration at some indeterminate point in the future, but aren't bugs or hacks, and might not necessarily even need to be changed. They're just... a big fat question mark that you or somebody else might want to circle back around to.Every programmer knows that naming things can be a tremendous tarpit. The only thing more tedious than choosing the best name for something is choosing a subtly misleading name which subsequently leads you or someone else on a wild good chase or possibly to fixing things (and accidentally breaking things) that never really needed to be fixed as long as the situation didn't change.
XXX is just the right convention precisely because it's so nebulous. NOTE doesn't work because something marked XXX isn't just locally descriptive, it's also a global marker that deserves to standout. WARNING doesn't work because that signals danger and hints that you may have done something suspect. But XXX doesn't necessarily mean code is suspect, it can be that it _might_ be suspect or that it _might_ be unnecessarily complex. ATTN is maybe the closest fit, but 1) isn't sufficiently loud and 2) lost out to XXX anyhow as a convention.
IME XXX is usually either 1) something that deserves reconsideration, and here's why ..., or 2) I'm too busy writing correct code to worry about the best description here, but here's a marker and possibly a sketch of a description for your future benefit.
Other than NOTE, I use XXX far more often than BUG or TODO. Committing a BUG comment is, I think, just poor discipline. If you know there's a bug, fix it or disable it.[1] I rarely use TODO inside code, but rather usually only in header files. That is, I use TODO to mark planned extension points. Inside implementation code I personally find TODO to be not much better than BUG, though reasonable people can certainly disagree on that point.
[1] I understand that sometimes neither fixing nor disabling is a realistic short-term option, especially in the corporate world. That doesn't make it any more excusable, though, especially if its your bug. And if you can actually get the BUG comment committed upstream one must wonder exactly how difficult it would have been to get an actual fix or mitigation upstream.
grep -r '\bXXX\b' corporate_code_base
Versus semantic tags
grep -r '\b(FIXME|TODO|NOTE)\b' corporate_code_base
And that is before you discover two new semantic tags in a single bug fixing dive.
Premature categorisation is a fundamental error, which will have repercussions down the track.
Rather than \b you can just use -w (whole word option).
If those fail, then traditionally grep used \< and \> to mark beginning and end of word respectively.
In that context the XXX's are kinda nice to have... we can mark there's something to work on; but only search for TODO/FIXME when looking for things that will actually impact currently needed operations.
Is it an actionable indicator or a explanatory indicator? What is its relative priority or importance among the others?
At least with all the other prefixes I listed it is dead clear what is actionable and what is explanatory. Better still there is an obvious priority albeit slightly ambiguous. Is TODO a higher priority than FIXME? But that can be addressed in a section of the README if necessary.
The other problem is allowing XXX in the code base allows for a catchall cop-out. Instead of giving the comment some semantic meaning just use XXX and let somebody else figure it out. That somebody could even be you in a few years. In one particular code base that had a few other prefixes the XXX were by far the dominate prefix, presumable because of a catchall cop-out slippery slope.
In any case, I think XXX should be dropped in favor of prefixes with some semantic meaning.