• Security incident: ISF was recently accessed by intruders. Please change your password, and change it anywhere else you used it. Read more

Source code comments, fun or profound.

MRC_Hans

Penultimate Amazing
Joined
Aug 28, 2002
Messages
24,967
Those of us that write or review source code will often see comments of more wit than just:

# Branch here if not found.

etc.

So I thought we could make a collection, here. I'll start with one I met long ago:

The AIM65 tabletop computer anno @ 1975 had a built-in assembler. Once you had compiled your assembly code, you would type in the starting address and toggle the run switch. The operating system would push the two address bytes onto the stack, and perform an RTI :eek: (Return from Interrupt). Comment in source code:

# And away we go!

Hans
 
An extremely cryptic music-playing program, written in Assembly with no comments.

Except one, on line 1750. The comment was RIPJSB.
 
Last edited:
I've always felt something vaguely profound, or ominous, in comments that said something like:

# We should never get here
 
I saw this in a javadoc that was describing the methods of a geographicsite object:

setFloor(java.lang.String value)
A reference to identify a single horizontal, usually flat, surface in a multi-surfaced building.

I don't know if whoever wrote it was trying to be funny - I found it amusing though.
 
I've left the following many times:

# Why are you reading the comments? You do know comments usually say what the code is supposed to do or what it did at one time, not what it really does now. READ THE CODE.
 
I do that all the time.

Haven't we all?

In the Old Days it was best is when it shows up on the mainframe print out, over-and-over, as the paper runs away. No wonder the operators used to think programmers were crazy.

And I must admit that I really never expected most of my imbedded comments would ever be read by someone else. :o
 
/* yes, this is a kludge!!!!!!!!!!!! */

This was, by the way, found in code which controls the operation of high-voltage transmission systems.
 
Last edited:
Not code comments, but debug messages in log files I have seen some good ones. Here's one example:

<date><debug> <message string> -------- YIPEE!!! IT WORKS!!!
 
I've seen comments containing the programmer's home phone number to call if it ever reaches that point.

I suspect it was put there by one of the other programmers. :)
 
"Removed Herobrine."

Full explanations here but a very successful troll of the minecraft community. (Short version: Herobrine is a ghost who is rumored to show up and scare players from time to time. There is much lore about him and where he came from.)
 
One day I was feeling a bit silly, and added a class module called "CVE". It had no code and just the comment to the effect of "This module is meant to handle excess entropy via a Charged Vacuum Emboitment. For details see Dr Who Episode nnn."
 
When I worked in the VMS group at DEC, I wrote the second-generation command line definition compiler. The first one was written by Hasterman (fictitious name). I began by writing a spec. While analyzing the existing syntax, I realized that in some contexts strings could be specified without enclosing delimiters, thus rendering the syntax ambigious.

I was required to make the new syntax backward compatible,* so I was forced to retain these undelimited strings, although they were deprecated. In the syntax spec, I called them <Hasterman-string>. That was a bit of sarcasm for which I was duly chastised.

So in the final spec, and in the code, they are called <H-string>.

~~ Paul

* Those were the days when backward compatibility was considered essential.
 
The most hateful comment ever:

//Good luck figuring this out.

I once saw a reference to a string like this while inspecting a program in Softice. I guess the author had taken good measures against crackers :D
 

ISF - Join now!

Every member here is approved by hand. No bots, no spam, just people who care about evidence and honest debate.

Membership is free!

Create your free account

Back
Top Bottom