Your own funny comments in code
-
I have one
Surcharge = (sel.x.SurchargePercentage.HasValue ? ((sel.y.SalesPrice.Value * sel.y.TotalQty.Value) * (sel.x.SurchargePercentage.Value * 0.01m) ) : 0.0m) // m is for M & M . No not really. It is required to convert 0.01 from double to decimal
-
Some old code I wrote back when I was first learning C++:
string Escape(const string& ToEsc) { string Return; for(unsigned long i = 0; i < ToEsc.length(); ++i) { char Check = ToEsc[i]; if(Check == '|' || Check == ':' || Check == '{' || Check == '=' || Check == ';' || Check == ',' || Check == '}' || Check == '\\') { Return += '\\'; //Escape from Problem Island: The Amazing Backslash } Return += Check; } return(Return); }
-
-
Nah, I'd prefer it to be case sensitive but you can't have more than one identifier that only differs in case.
-
How about we compromise: keywords are case insensitive but get really upset when you're insensitive to their case.
-
Filed under type appropriation
-
how about pity pseudo code? this one is fresh out of my butt:
illusion = 0 async choice: result = 0.34 * random * illusion delay 8 # seconds return result Life: born = 0.33 * random # either 0 or 1 happy = random dead = random while not dead: illusion = random # perception luck = 0.33 * random * illusion happy = (born + luck + choice) > 0.5 # is the glass half full? dead = random
-
Mine are usually in commit messages (read bottom-up):
-
I once had a line flushed to the beginning of a Windows Installer log that said something to the effect of "this horrible script makes me want to claw my eyes out" but I removed it after testing in case someone actually saw it someday and said "that's disturbing" or "that's unprofessional."
I think the exact line might still exist on some systems that I used for testing, let me go check...
-
-
I ended a similar commit comment chain once with something like
3 compilers - 4 opinions of valid C++
-
I haven't really had any amusing ones myself. I did have a coworker that had a comment in some 3rd party data structure parsing code along the lines of:
"I want to find the engineer responsible for this, tie him to a tree, pour honey on his head, and unleash a bear."
-
if(err) {
Exception up = new Exception();
throw up; //heh
}
-
@mikehurley said:
"I want to find the engineer responsible for this, tie him to a tree, pour honey on his head, and unleash a [...]
I expected to read "swarm of bees" here.
-
try { [snip] } catch (Exception up) { log(up); if (recoverable(up)){ return recover(parm, meatball, sauce) } throw up; }
-
'd
-
-
-
```
try {
[snip]
} catch (Exception up) {
log(up);
if (recoverable(up)){
return recover(parm, meatball, sauce)
}
throw up;
}What I'm puzzled by is what is recoverable with grated parmesan garnishing meatballs in a rich tomato sauce…
-
What I'm puzzled by is what is recoverable with grated parmesan garnishing meatballs in a rich tomato sauce…
hmm... well as one of my coworkers keeps saying about the lunches he brings to the office: IMAT
-
I think it re-covers the meal with the arguments.
-
VBScript:
text = Left(Msg.Body, -(a < b) * a + -(a >= b) * b - 1) 'evaluate min(a, b) - 1 on hard mode: no such function as 'min' 'BUT SURE, YOU CAN TOTALLY MULTIPLY BY A BOOLEAN (True = -1)
-
PLC5 digital output O:10/2 Loud obnoxious horn
On a different occasion I was working on a mixed salad line and added picture of Dana Carvey to the panelview screen. He was visible when the broccoli chopper was running.