
The origins of XXX as FIXME - panic
https://www.snellman.net/blog/archive/2017-04-17-xxx-fixme/
======
eddieh
Personally, I can't stand XXX as a comment prefix. It is semantically null as
far as I am concerned. Just looking through the comments here shows several
different possible meanings: FIXME, HACK, TODO. But I've seen it alongside all
of FIXME, HACK, NOTE, TODO, BUG, ATTN, as a complete separate and distinct
type of comment prefix.

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.

~~~
Apocryphon
Maybe YYY as in, "Why, why, _why_ did you implement it in this way?!"

~~~
Florin_Andrei
YOY is sometimes appropriate.

~~~
eddieh
YOLO for "I have no idea how or why this works (it might not even work for all
cases)"

~~~
Apocryphon
That's more for a Do Not Fix label: [http://catb.org/jargon/html/magic-
story.html](http://catb.org/jargon/html/magic-story.html)

------
dahart
I'm pretty sure that use of 'xxx' predates computers as a stand-in for "some
stuff". Like a Kleene star before regex existed.

To me it seems uninteresting, and perhaps even misleading, to try and find the
'first use of xxx' on computers.

I started using "XXX TODO" in college 20 years ago and I don't remember ever
seeing it anywhere, it was a natural thing to do. I occasionally had "todo" in
comments and code I wanted to fix very soon, and adding the 'XXX' was the
easiest thing to add to make it searchable with no false positives. For
whatever reason it seemed like an obvious thing to do. It's possible I picked
it up somewhere, but I wasn't reading much code, there was nowhere near the
access to public repos then that there is now. I'm pretty sure I invented it
independently along with many other people.

> Why he chose to switch to the rather inconvenient XXX from ### is unclear.

I don't understand this comment... XXX is easier to type than ###. Caps lock
works for X's and not for #'s. Even when using the shift key, X is a shorter
throw than #.

~~~
jsnell
The inconvenient part of XXX are the false positives when searching.

I don't buy the independent discovery idea (despite also thinking at one point
that XXX was just my personal convention). When you pick up something through
osmosis, you don't remember the exact source where you learn from. If this
really was something that programmers just do naturally rather than learn, the
programmers of the '60s and '70s would have been doing it too, and there
should be some traces of it in the record. But at least I can't find those
traces.

~~~
slizard
> The inconvenient part of XXX are the false positives when searching.

Would you mind elaborating what kind of source code contains numerous triplets
of the uppercase character "X" and why?

I have never seen such code other than produced by extremely inexperienced
programmers/students with no imagination to naming symbols and ending up with
"x", "xx", "xxx" variable names; even those cases will most likely not be all
uppercase.

~~~
pcmonk
There's several good examples early in the article. Mostly, they end up in
comments, where they're used as templates (e.g. "a social security number is
of the form XXX-XX-XXXX").

------
ISL
I learned XXX as a placeholder for FIXME from a scientist who learned to write
physics papers in the 1980s. I believe he learned it from someone trained in
the early 70s. It flows well in text: "The measurement performed by XXX in
1985 observed the same effect, but at the XXX-confidence level."

I solve the XXX-as-stand-in-for-foo degeneracy by adding priorities to my
XXXs: XXXRC, XXXMA, XXXMI, for release-critical, major, and minor bugs.

A simple grep | wc shell script allowed rudimentary but extremely flexible
bug-tracking when I was writing up my thesis.

~~~
lionyo
For journalists, the placeholder typically taught is "TK" for fact-checking
later, as in "The youngest president was TK years old."

~~~
jwilk
Why "TK"?

~~~
jwilliams
Stands for "to come"
[https://en.m.wikipedia.org/wiki/To_come_(publishing)](https://en.m.wikipedia.org/wiki/To_come_\(publishing\))

Theory is that TK was a less common letter combination than TC.

~~~
jcheng
In case anyone is curious, like I was:

    
    
      $ grep -i tc /usr/share/dict/words | wc -l
          1055
      $ grep -i tk /usr/share/dict/words | wc -l
            40

------
33degrees
I've always interpreted XXX to be the same as HACK rather than FIXME, as per
Java's coding standards:

"Use XXX in a comment to flag something that is bogus but works. Use FIXME to
flag something that is bogus and broken."

~~~
rb808
I hadn't heard this before, I found a doc here - is there something more
recent?
[http://www.oracle.com/technetwork/java/javase/documentation/...](http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-137265.html)

~~~
33degrees
Not that I know of, that's where I found the exact quote I used...

------
syncsynchalt
Personal anecdote: I use "XXX" as a marker for "you must clean this up before
committing/publishing", similar to "DO NOT PUBLISH" in a CMS. The reason I do
this is because it visually stands out well when scanning through the output
of `git add -p`.

When used in that form it satisfies all the author's concerns, as it's just a
marker to myself that presumably needs no other context (as I usually mark and
resolve within a few hours).

------
thinkingkong
Ive always treated XXX like a sentinel that should be grepped for before
committing code. Its really just temporary garbage that shouldnt pollute the
repo. The fact that my editor highlights XXX by default is the reason I keep
using it.

~~~
twic
This is also what i do (although only as of a few weeks ago!). I've added the
check into my standard Git pre-commit hook:

[https://bitbucket.org/twic/devtools/src/762878a5f3d9c83ffa2a...](https://bitbucket.org/twic/devtools/src/762878a5f3d9c83ffa2ad9a8534e6978a55833ec/git/commit-
msg.messagepattern)

------
bluejekyll
I hate XXX as a placeholder for FIXME or TODO. There is no indication about
its importance or meaning:

    
    
      XXX temporary variable
    

Doesn't tell me, "hey, you should replace this temporary variable". If it did
have a better comment, then it would be better, but still doesn't literally
say FIXME!

I use TODO for things that are potential performance, memory utilization, or
design issues.

FIXME I reserve for things that really should or must be fixed prior to a
release. These include security issues, rare bugs, or improperly handled
exceptions.

Most editors now have plugins that also match on TODO and FIXME which draws
your attention to them in the code.

------
jampa
Cant find the source now, but I read a theory that the origin of XXX is due to
old movies and cartoons that shows poison in a flask with the "XXX" label, and
it was used in programming to mark "poisonous code".

------
random_comment
I have used XXX (and ZZZ) in my own code because they are the only tokens that
satisfy these 3 things.

1\. It stands out clearly visually in the code.

2\. It is not normally a keyword, variable or string in my code.

3\. I can type it quickly and comfortably using only my left hand and two
fingers, while my right hand controls the cursor to navigate (or is moving to
the keyboard after cursor navigation).

I usually start typing it during the interval as my right hand begins moving
left over the keyboard to prepare to type the comment that will follow.

I suspect XXX and ZZZZ are not simply conventions that are picked up by
exposure to other people's code, I think they represent a local maximum of
convenience for these three criteria.

Try typing any other token (e.g. TODO) and see if it satisfies these criteria
as well as XXX or ZZZ.

------
pacaro
In older windows NT code — within the OS itself, not applications — doubling
was common, so comments would have BUGBUG, HACKHACK, CHECKCHECK or similar.
IIRC these were globally cleaned up in the Longhorn (vista) timeframe

Maybe this was part of Cutler Normal Form, but it's been over 10 years, so my
memory is hazy

~~~
jcoffland
Like "Built on Windows NT Technology" which expands to "Built on Windows New
Technology Technology." I believe this appears during the install of XP.

------
luckydude
I'm with the author on XXX being a crappy thing to grep for, too many false
positives. When I got to Sun and was hacking the kernel, I settled on LMXXX,
that was fairly unique. Haven't looked in a while, but there used to still be
some in the Solaris UFS code (not exactly proud of that).

tl;dr: use your initials plus xxx and you can find 'em.

~~~
cpeterso
Google's coding style guide calls for TODO comments to include the author's
username, like `TODO(username)`, for future blame attribution:

[https://google.github.io/styleguide/cppguide.html#TODO_Comme...](https://google.github.io/styleguide/cppguide.html#TODO_Comments)

~~~
QuercusMax
Internally this is now discouraged; preferred is TODO(b/12345678), where b/ is
the shortcut for our internal bugtracking system.

------
GunlogAlm
Probably a silly question, but what's the "obvious reason" for using XXXYYY in
this paragraph?

" _Some DEC code seems to have gone really overboard with this, with single
source files having half a dozen different XXXYYY identifiers. (Sorry, had to
use YYY as the placeholder there for obvious reasons)._ "

~~~
tene
By my reading, that parenthetical comment is implying that the author
initially considered "XXX" as a placeholder for the letters coming after a
literal "XXX" in the DEC source code, but couldn't use "XXX" as a placeholder
because it's also being used literally as the prefix, so "XXXXXX" would not
demonstrate what the author was trying to communicate (that the DEC code in
question had many instances of the letters "XXX" followed by three other
letters).

------
escape_goat
My own habits leave me wondering if the use of C-s as a search command in text
editors is related to the semantic consolidation that Snellman sees of 'XXX'
as a 'FIXME' synonym.

In a lengthy file where I will repeatedly need to jump back to a particular
spot, I tend to leave a 'xxx' comment in that place until I'm done.

I believe I ended up doing so largely because `xxx` is unlikely to appear
anywhere else, and thus, with a habit of pressing C-s as a left-handed chord,
it becomes efficient to hit `x` three times and then C-s through instances as
needed.

Any place where such a reference marker was left in the code would indicate
that the code editor knew he needed to return to that point, making it likely
that a verifiable but non-fatal flaw could be found in the code there,
reinforcing the association with a 'FIXME' semantic.

------
SwellJoe
FWIW, I use XXX, and I've never come across an instance where XXX was anything
_but_ a FIXME/TODO. It doesn't show up in any project I've worked on, in the
ways the author exhibited. e.g. IP addresses usually use lowercase xxx, if
they use letters at all. I see a lot of network-related code, and XXX is just
not a thing I see, outside of comments.

But, really, I don't have strong opinions. My editor can highlight anything I
want to use for this purpose, and I think they're all (XXX, FIXME, TODO)
pretty universally recognized as meaning "This code is kinda ugly, and we
ought to do something about it." which is maybe enough granularity in the code
itself when we already have ticket trackers, source control, unit tests, etc.

------
the_mitsuhiko
From my experience and use XXX is not FIXME. XXX means something requires
attention but does not necessarily imply it being broken. For instance an
important line could be marked at that. Often it does imply that something
should be refactored however.

------
kbob
I wonder how old the author is. I "knew" the XXX convention was from CSRG, and
Bill Joy would have been my first guess. I expect most people who worked with
Unix in the '70s or early '80s would have guessed the same. I read a lot of
Bell Labs Unix source, never saw XXX, and immediately noticed it when I got my
first BSD tapes, especially in areas where Joy had worked. (BSD 4.1c, I
think.)

In another 30 years, this would be interesting archaeology, since hackers of
that generation will all be dead. But today, it's just "ask somebody over 60
if they remember."

~~~
gonzo
Over 50 will do. I also "knew".

------
smnplk
If we want our kids to grow up as good coders, we need to remove all the XXX
content from our codebases.

------
mark4o
I suspect that the reason for switching from ### to XXX is that grep ###
requires quoting in the shell.

~~~
jsnell
I like that theory!

------
zck
For some reason, I use "zck" (my initials) for meta-comments in code, mainly
instead of "TODO", but also for TODOs that aren't just code, as in
([https://bitbucket.org/zck/zpresent.el/src/08ae558834c25ebca8...](https://bitbucket.org/zck/zpresent.el/src/08ae558834c25ebca867e8885f1a0628684c823b/zpresent.el?at=default&fileviewer=file-
view-default#zpresent.el-605)):

After a comment explaining some math:

    
    
        ;;Add one here so that we round away from zero. We want to have more whitespace on the left than the right side.
    

I then have a comment to think about if that makes sense to do:

    
    
        ;;zck is this what's wanted?
    

I haven't set up the rules for doing this explicitly, but have a pretty
intuitive understanding as to when I should do this. In some ways, this is
instead of using a real issue system -- which I also do, but not for
everything.

~~~
veddox
I use my initials when I'm getting to grips with a new code base. It's not for
committing, just as an aid when I'm jumping around following the code.

------
amichal
For me: XXX is for putting into log messages you want to grep for while
debugging. They get commented or turned into useful log messages before
committing/merging.

Edit: I have never used them for comments... Those either have TODO/FIXME or
are (hopefuly) useful explanation of the high level task the code is trying to
accomplish

------
bartc
When you make a mistake on a typewriter with no delete key and no white-out
handy, you could back up to the beginning of the error and type "XXXXX" over
everything and start anew on the following word or line.

Someone likely carried this forward as an indicator of a mistake (ie. "hacky")
and then it stuck from there.

------
cpeterso
"See Page XX" was such a common typo in early D&D books, where someone forgot
to update a page number reference, that there is a RPG blog called "See Page
XX":

[http://site.pelgranepress.com/seepagexx/](http://site.pelgranepress.com/seepagexx/)

------
avidal
I personally use XXX all the time; but I tend to use it in places where
perhaps ATTN or NOTE would be more explicit.

It may be simply an artifact of other code in the past; when I switched to vim
~10 years ago I noticed XXX was specifically highlighted along with FIXME and
TODO and so I used it as a third option: here's something that doesn't need to
be fixed, isn't really a todo, but you _should_ read and understand.

Interestingly, I just did a quick check in vim to see which prefixes were
highlighted and ATTN / HACK were not, but the usual suspects (BUG, FIXME,
TODO, NOTE, XXX) were. I should probably use NOTE in most places that I
currently use XXX...

------
cpburns2009
I prefer to use an XXX comment to mark temporary code when debugging a
specific issue. It's an easy reminder to myself that it should be removed when
I'm done.

------
wink
Interesting, I've never seen any XXX that was deliberately put into code and
not just forgotten to be removed before a commit.

I'm equally likely to put asdf or www or aaa or yyy. Just to grep in debug
output when doing println debugging.

------
diminish
Another reason why I put XXX, FIXME or TODO is to be able to rgrep later
easier - I want to avoid any kind of subtext which may occur inside variable
names etc. so XXX satisfies this.

------
tajen
I personally use NO_RELEASE and TODO, the former can't pass the release script
(such as isLicensed=true), and both are brightly colored keywords in IntelliJ.
Am I alone?

~~~
optimuspaul
You are not alone. I've never even seen XXX used in the 20+ years I've been
slinging code. TODO is by far the most common, FIXME once in a while. I like
NO_RELEASE as a concept, but I haven't seen that.

~~~
mwfunk
Same here. 20+ years professional experience with a bunch of different
companies, industries, languages, and locales. TODO/FIXME are the only ones
I'd consider universal, and I have literally never seen anyone use XXX. I
don't doubt that people use it or even that it's common, I'm just confused as
to how I could've missed it. Maybe it's not as common as everyone here thinks?
Or maybe it's common in corners of the industry that I haven't spent much time
in (like web development). No idea.

------
gonzo
Asked wnj about this (pointed him to the original post and this thread).

His response: 'XXX doesn’t mean TODO, it means “should be better, fix it
later”'

------
Animats
I use

    
    
       ***TEMP***, 
       ***NEEDS WORK***, etc.  
    

Those you can find with grep.

(HN needs less broken Markdown.)

------
phlakaton
I would never willingly use XXX in code, for one simple reason: it's an
abbreviation for pornography. All other arguments against it (and I think
they're good arguments) would be dwarfed by the brief but squicky feeling I've
gotten whenever I've encountered one of these tags in a codebase.

I don't have any particular issue against other sequences of X's run together,
but that particular one is off-limits as far as I'm concerned.

~~~
optimuspaul
haha, yes!

