I have seen this a lot in code, even vim marks it as a special case. #TODO
and #FIXME
are two other fix markers vim highlights but what does #XXX
mean?

- 20,799
- 66
- 75
- 101

- 6,712
- 7
- 32
- 29
-
13The question is asking about codetag or comment best practices in Python programming. There is Python Enhancement Proposal discussion on the subject. The question deserves to be retained on SO. It could have been worded a bit better though. – nik Sep 21 '09 at 05:28
10 Answers
XXX
in a comment is usually a heads-up. It could be:
- Something that's not implemented completely correctly.
- Something that should be fixed later on.
- Highlighting a possible problem spot.
- Something you're not sure about, a question.
I've often preferred a more descriptive tag like FIXME
or TODO
or HACK
. XXX
is often used as a catch all for the above.
Searching for 'XXX' on the FreeBSD code cross reference is a good example of many of the uses. There are thousands...

- 6,729
- 4
- 34
- 26
-
1What's funny is that I use this on my own. XXX or #XXX basically trips the compiler and reminds me to go back on something. Generally pointer references or a previously unknown value or variable name. – bobby Sep 21 '09 at 05:11
-
6This confirmed my original guess, It's simply a catch all tag to indicate other programmers to highlight that comment as something to look at. – Jorge Vargas Sep 21 '09 at 05:13
-
1No trying to troll, but "HACK" is not descriptive. In fact, it is very ambiguous. To me, it could mean at least 3 things. – Ярослав Рахматуллин Aug 31 '18 at 08:24
-
4@ЯрославРахматуллин in source code I would always read it in the "this is an ugly hack job, but seems to work well enough" sense - something you'd like to clean up later, but is not urgent. I've not used it (I typically use `TODO` or `XXX` instead), but that's how I would interpret it. – Iiridayn Mar 06 '19 at 19:15
NOTE
: Description of how the code works (when it isn't self evident).XXX
: Warning about possible pitfalls, can be used asNOTE:XXX:
.HACK
: Not very well written or malformed code to circumvent a problem/bug. Should be used asHACK:FIXME:
.FIXME
: This works, sort of, but it could be done better. (usually code written in a hurry that needs rewriting).BUG
: There is a problem here.TODO
: No problem, but additional code needs to be written, usually when you are skipping something.
At least this is how I was taught about these tags. Basically the first two (NOTE
and XXX
) are used for information and no action is required. While the last three (FIXME
, BUG
and TODO
) do require action. HACK
is somewhere in between (and hardly ever used I think?).
-
13Good list. I also like `LAZY` (not as critical as FIXME or HACK) and `OCD` (known overengineering). – SineSwiper Jun 01 '13 at 00:38
-
4Do you really use XXX like this? I've come to see XXX as much higher priority, meaning "this is something that must be fixed before this code is even submitted to revision control". That's the way it's used inside google, automatically enforced, so you might see XXXs during code review but it's impossible to submit the code until the XXXs are gone. Longer-lived to-do notes can be marked with [TODO, which are allowed to be submitted as long as someone's name or a bug id is attached.](https://google.github.io/styleguide/cppguide.html#TODO_Comments) – Don Hatch Jul 17 '18 at 04:47
-
My C editor also knows ??? and I use it for every piece of code I don't understand, usually if I wrote it myself long ago !!! – dargaud May 28 '21 at 14:05
-
SETUP: on this line, I need to manually choose some option like True/False, or a Number, etc for some testing. – John Nov 22 '22 at 03:25
-
1DEV: temporary setup in this line during the development, like: I commend (disable) the command, or change it, etc... to help my debug, after done, I remove – John Nov 22 '22 at 03:25
Some notes from a June 2005 Python Enhancement Proposal that was rejected.
Choosing between
FIXME
andXXX
is difficult.
XXX
seems to be more common, but much less descriptive.
Furthermore,XXX
is a useful placeholder in a piece of code
having a value that is unknown.Thus
FIXME
is the preferred spelling.
Sun says thatXXX
andFIXME
are slightly different, givingXXX
higher severity.
However, with decades of chaos on this topic, and too many millions of
developers who won't be influenced by Sun, it is easy to rightly call them synonyms.
The PEP Starts with,
This PEP has been rejected. While the community may be interested,
there is no desire to make the standard library conform to this standard.
...
What Are Codetags?
Programmers widely use ad-hoc code comment markup conventions to serve as reminders of sections of code that need closer inspection or review. Examples of markup include
FIXME
,TODO
,XXX
,BUG
, but there many more in wide use in existing software. Such markup will henceforth be referred to as codetags. These codetags may show up in application code, unit tests, scripts, general documentation, or wherever suitable.
The PEP is an interesting read.

- 86,207
- 24
- 208
- 215

- 13,254
- 3
- 41
- 57
Have a look at PEP350. It explains all of TODO
, XXX
etc. I use it everyday when I can't remember exactly what one of the code tags means.
-
1Do you know if PEP350 is the origin of these labels? Do you know any older documents (from the Unix era) describing how to use these labels? – Ярослав Рахматуллин Aug 31 '18 at 08:26
From (old) Java code conventions:
Use XXX in a comment to flag something that is bogus but works. Use FIXME to flag something that is bogus and broken.

- 2,573
- 28
- 22
-
THis is the correct answer. I think it originated with Apache in the early days, but I haven't bothered to look that up. – Brill Pappin Nov 06 '20 at 16:23
I use XXX
because it's easier to type than TODO
.
XXX
is for when you're in a hurry and will get back to this yourself.
TODO
is for when you have to hand it off to someone else.

- 158,662
- 42
- 215
- 303

- 384,516
- 81
- 508
- 779
-
1XXX means "I'm in a hurry and will get back to this myself" TODO means "This is an official part of a future backlog request that will be assigned to someone else." Those are the literal meanings. – S.Lott Oct 02 '09 at 13:25
-
3And which RFC are those "literal meanings" in? Or is there any other citation for that? – Randall May 12 '11 at 19:50
-
7@Randall: "citation"? Sorry, it's just my understanding after reading a lot of code. – S.Lott May 12 '11 at 19:58
Probably it's for cases that you don't know how to handle.
Check out this: List view of TODO/FIXME/XXX/HACK statements
(source: googlecode.com)

- 21,988
- 13
- 81
- 109

- 42,588
- 16
- 104
- 136
XXX is short for caveat which is slightly different from NOTE but quite similar to HACK. It may be a bug in a third party library / code which is being used and the code with // XXX: indicates that either it is workaround due to a bug in third party code or it could mean "caution" to someone looking / modifying the code to indicate why something is done in a certain way which otherwise may seem incorrect / inelegant in first look. HACK is generic term meaning a workaround for an issue which could be present in either your own code base or a third party library.

- 1,213
- 1
- 20
- 44
I believe while FIXME
is for the developer, and HACK
is for the maintainer, XXX
is for the user.
For example, if you ignore the XXX
and call this function elsewhere, without understanding how it works, something unexpected can happen, and the person dealing with this issue will be unhappy (at least the one who added the XXX
thinks so). You may think the problem will be gone if you just don't use this function.
But for FIXME
, you will feel worthy to just fix the code to make it work. And for HACK
, you may have no better choice even if you don't use it.
If you wrote XXX
on your own code and someone used it, you may feel unhappy for reasons like you completely rewrote that code, and it then behave in completely different ways, and you broke someone else's code. But if you left a FIXME
or TODO
instead, you won't care so much.

- 586
- 5
- 13
I use // XXX so I don't have to remember line numbers. Instead I just search for the XXX when I want to return to that piece of code.