Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

What do people generally mean whenever you see XXX in a comment. Occasionally, I'll see a comment like this:

# XXX - This widget really should frobulate the whatsit

Of course, I can tell what the comment means, but what does the XXX generally mean? Is it saying "This is a hack" or maybe "Perhaps we should revisit this later"? Or is it saying something else entirely?

share|improve this question

closed as primarily opinion-based by MichaelT, GlenH7, gnat, Bart van Ingen Schenau, jwenting Aug 26 at 10:46

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

9 Answers 9

up vote 29 down vote accepted

What XXX represents, depends on the author of the code. In general, it is used as a marker for code that requires attention.

However, this web page states a somewhat different train of thought:

XXX : used to flag something that is bogus but works FIXME : used to flag something that is bogus and broken

I guess this further shows that its meaning is not well defined and is used differently.

share|improve this answer
4  
HACK would be an alternative to XXX. –  Richard Apr 6 '11 at 8:16
1  
link is broken :( –  Jack Sep 14 '12 at 16:35

IIRC it is an annotation that predates and has similar meaning to TODO or FIXME annotations. It's quite common in vim's source, for instance.

share|improve this answer

It's a dirty piece of code ;)

share|improve this answer
2  
Is this a funny answer or a funny and correct answer? –  KoMet Mar 28 '13 at 11:07

It means nothing. It's just a sequence of characters that is visually distinctive (which makes it easy to scan for manually) and unlikely to appear in either code or comments (which makes it easy to search for programatically).

So, it is used as a marker to flag comments that need to be easily searchable. Usually, it marks a piece of code that needs to be revisited.

share|improve this answer
    
Also easy to find with grep or the like –  Zachary K Apr 6 '11 at 8:10

Per Wikipedia: "XXX to warn other programmers of problematic or misguiding code." -- which might be pulled from containers of poison that say "xxx" on them; super old school.

If it's a TODO note, here's a related blog post on it called, TODO or not TODO, which covers using GREP to sort comments by date, owner, etc.

share|improve this answer

It is most likely a character sequence which does not occur in regular code, meaning that it is easily searchable from a command line:

ravn:tmp ravn$ echo XXXX This is very bad > processor.c
ravn:tmp ravn$ echo XXXX Verify defaults before going in production > main.c
ravn:tmp ravn$ grep -R XXXX .
./main.c:XXXX Verify defaults before going in production
./processor.c:XXXX This is very bad
ravn:tmp ravn$ 

(example is for Unix, I believe "findstr" does the same under Microsoft Windows)

share|improve this answer

but what does the XXX generally mean? Is it saying "This is a hack" or maybe "Perhaps we should revisit this later"? Or is it saying something else entirely?

Any of the above.

The choice of XXX versus TODO or FIXME or HACK or something else is not governed by any strong rules or conventions. Basically, it means whatever the person who put it there intended it to mean. It may be obvious ... or it may be totally opaque to you.

share|improve this answer

It is most probably a marker that can later be found. Unlike TODO or FIXME or the alike, XXX is very rarely found in any word or construct, therefore making it perfect for a marker that will stand alone when files are being searched through.

share|improve this answer

Where I am originally from we use XXX (and then YYY, ZZZ) for numbers that we do not know them yet, for example: add XXX to YYY to find the result, then add 10%.

Originates from equations at school where 'x' is the unknown variable.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.