- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
I remember a comment I once wrote myself.
// setting sibling0 as the parent of all other siblings (incest)
Admin
[DontTazeMeBro] Probably part of the Share the pain program http://www.metacafe.com/watch/88657/share_the_pain/
Admin
I did a project with a very extensible physics engine. I was extending it to include a "Flash" behaviour:
class Flash /AaaaaAAAAAAHHHHH!/ : public PhysicsBehaviourBase /* Saviour of the Universe! */
Admin
DIIIIIIIIIVVVVVVVVEEEEEEEEEEEEE.
Man, BRIAN BLESSED makes everything better.
Admin
Perhaps CometWorkers.OnFirstJoint has been triggered too much, leading to Comet's - major UK electrical chain's - recent demise.
Admin
That must be triggered first thing every morning at Comet given my experiences there.
Edit: well damn! Warren inb4 me! Edit2: and after me, too.
Admin
Perhaps CometWorkers.OnFirstJoint has been triggered too much, leading to Comet's - major UK electrical chain's - recent demise.
Admin
One of the best I have seen was: "Oh magic numbers, guide us to the light!"
Admin
Sadly source control and peer reviews remove most of the funny comments or clever variable names.
marypoppins = (superman + starship) / god;
Admin
Admin
These should be CodeSODs
but then yesterday's should have been a feature article, as it was not so much about the bad code but the developer's reaction when he wanted to fix it.
Admin
"Brian claims that [DontTazeMeBro] is never returned . . "
Sounds like another episode of "Famous Last Words"
Admin
Hunh. I thought I had made it a CodeSOD. One too many triggers of OnFirstJoint, apparently.
Admin
Great, so now we're gonna get all the HILARIOUS comedians in the comments telling us all the HILARIOUS things they've written in code.
Admin
I see your CodeSOD and raise you a Coded Smorgasbord in honor of it being Thanksgiving Eve....and today's article a bunch of CodeSODs.
Admin
I once put a series of "All your base register belong to us" comments in some hardware initialization code.
base->register = data; // Move zig.
return; // For great justice.
Admin
Off the top of my head, what I can think of is that I have seen The Doors' "This is the end" referenced in both the (completely unrelated) codebases I have professionally worked on so far.
Admin
I once thought I had a bug in my code. After hours of searching, I found the culprit. A Windows DLL file. The name of that file: HASPMS32.DLL
I was dumbfounded and thought I had a virus. Nope, that was the actual DLL file.
Admin
The best I ever did was not easily seen in the code but was obvious to one single user of the system.
This was one of those Director types that actually still wanted to do work. Commendable in most cases, but he would delete something then come running into the lab saying it was an accident and ask us to recover it. Granted it was simply flipping a flag on the record, but we made the mistake of making it look easy a few times so he never saw the prolem with interrupting us with something he should have been more careful with.
That is until the next release triggered only by his login credentials.
User: delete Dialog Box: Are you sure? yes no User: Yes Dialog Box: Positive? yes no User: Yes Dialog Box: Are you certain? yes no User: Yes Dialog Box: Absolutly? yes no User: Yes Dialog Box: Sorry <Director's Name> automatic recovery initialized.
Bringing him right back to where he was, attempting to delete again would follow the same script, he had to get his secretary to delete it for him (yes another WTF, she had access to do this, but we never saw a mistake from her). He came walking into the lab and said, "Okay, I get it guys, can you fix it for me?" He was told yes, but had to wait for the next release. From then on he was a bit more thoughtful when the "Are you sure?" message box popped up, fearing the never ending cycle returning.
At least he had a good sense of humor about it and none of us got yelled at for it.
Admin
this ˆ
Admin
I once found a comment like this in some serious code is was working on:
Well, you get the movie reference.
Admin
My favorites are checking isDirty on private members
Admin
Better than a useless prediction.
Admin
This is from someone who left my company a while ago:
and
Admin
WordPress uses the variable $pee to represent
in the markup. Found this little gem in the codebase:
$pee = preg_replace('!
\s*(</?' . $allblocks . '[^>]>)\s
!', "$1", $pee); // don't pee all over a tagAdmin
This reminds me of an error we had to troubleshoot about ten years ago while consulting for a customer in the transportation industry:
Our support team received a ticket from an internal user of our reservation system. Apparently the sales clerk had received a pop-up window with the error message:
"RAAAAAHH. BRAINS. MUST FEED."
Our first thought was that someone had added this code at the last minute into our newest released version. However, examination of our entire codebase and version control history provided no hits (obfuscated or otherwise). Eventually we came to the conclusion that this message was being passed back from our 1970's-era back end system (implemented in COBOL, of course) and being displayed as-is.
Since we didn't have the source code for the other system, our investigation stopped there. However, the original system had been in use for roughly 25-30 years and our own system had been in use for around 7 at the time. This error had never been reported before and was never seen since (the application was eventually retired a couple of years ago). It would be interesting to know what set of special circumstances triggered this dormant joke and how long it had lain in waiting.
Admin
Two drums and an asynchronous JSON response fell down a hill. Ba-da-BOOSH! :D
CAPTCHA: facilisi - The silliness of the article facilisitated the poor joke above! But not this one.
Admin
I remember reading my old code, and a particularly ugly hack was commented:
"Forgive me future David."
Admin
So, I shouldn't name all references to objects with a 'transform' method after autobots?
Admin
That would be an awesome codebase. However, it would probably A)insta-fail a code review, therefore B) being rewritten so quickly, the world would fail to experience the awesomeness.
CAPTCHA: nulla - In other words, you can count on that being nulla possibilities. Ba-da-BOOSH! :D
Admin
I try not to commit anything that would confuse people... but occasionally I can't resist turning legitimate things that look like emoticons, all the way into emoticons. Like, say, if you're sticking an underscore into the middle of a string: string newString = string1 +"_"+ string2;
How can you -possibly- resist turning that into:
Also, that quote about joints, reminds me, I've always wondered how that song about smoking two joints didn't trigger a stack overflow of joint-smoking:
Admin
Too bad you'll never actually come around to smoking a joint like that.
Admin
Admin
By policy, the following requests always take a minimum of 24 hours to resolve:
It's called demand management. Make it easier for them to do the right thing the first time. It's really for their own good, in the long run.
Admin
While taking my college programming courses I got a part time job doing utterly brainless work on an old CRT based system. At the end of each action it would prompt:
SYSTEM READY
Being incredibly bored, I discovered I could use the cursor keys to modify the message, then backspace to erase it from the input buffer so it wouldn't become part of the next command. One day at the end of my shift I left my station saying:
SYSTEM READY FOR COMBAT
The next day the supervisor reprimanded me. Just because I was taking computer classes didn't mean I could reprogram their system. She said the next shift was afraid to use that station and they lost productivity as a result. I showed her how much difficulty and technical acumen was required to "reprogram" the system. She was, still, not amused.
OK, not humor in source code, but she thought it was.
Admin
Found this gem in our code repository:
Followed by a really detailed description of why the file the comment was found in is such a mess. Perhaps to appease the future maintainer of the code into not murdering them?
Admin
$months = array('Nullember', 'January', 'February' , ...
Admin
Sounds like a zombie process
Admin
Admin
Admin
Here's a Java one:
Admin
Admin
Admin
One of my earliest coding projects was for a place that put on group events. One of the options was for including Beer and Wine for the guests, at an additional price of course.
There was a lot of logic that had to be handled internally and I was one for meaningful variable names. Also, intellisense was not as good back then, so I wanted to shorten BeerAndWine to something else... especailly in its various permiatations
So I just called it Booze.
I had a lot more fun with the project after adding in Booze.
(It was an early project of mine in VB6. I wouldn't have a dozen or so fields, objects, flags, etc with BeerAndWine in the name these days, or would I need to do it the way I did. Very interesting integration with their accounting and contact management systems).
Admin
Then there was my other little project. I was actually the Helpdesk lead at the time, but we ended up with little LOB coding projects to help out the agency.
They wanted a single icon for these utilities, which resulted in a launcher screen that went to the various modules. It had 3 buttons, so messing with them was not too much of an issue.
On the launch I ran a routine called "CheckHoliday", which would change the colors of the dialog for each holiday... reds and pinks for valentines day. Shades of green for St Patrick's day etc.
Then their was April 1st. I inverted the order of the text on the buttons. The icons were the same. It also added a message that said "Happy April Fools Day". The first time it generated a a few helpdesk calls, but no harm, no foul. The agency considered removing it, but it was too much fun and the few extra helpdesk calls helped practice good customer service.
A few years after I, uh, was no longer with that agency, I heard it still did that.
Admin
You know this reminds me of when I was little. I found a book about Applesoft BASIC programming (guess my dad had picked it up somewhere when we got our Apple ][) when I was about 8 or 9 years old. (How old are you in 4th grade? 8 or 9 right?) We had computer lab time, which basically meant we all sat down in a room inside the library, filled with Apple ]['s, and we were supposed to play with LOGO. I took it upon myself to break into Apple DOS and write the following program:
10 PRINT "I CAN BEEP!" 20 PRINT CHR$(7) 30 GOTO 10
Then I proudly ran it. The teacher was not amused. She heard the commotion, walked over, saw what was printing on the screen, and said "Yes, I can see that. Now make it stop."
I always thought she should have been far more impressed by the skills of a young programmer-in-the-making... oh well.
Admin
Ok, here's my egoic story. I once wrote an app in Powerbuilder, and attached a rather good Windows Help File, with context help and loads of good user documentation (I think). But then I had a boring afternoon, and wrote an FAQ section. Hidden in the depths, I put an entry "How do I: Make Potatoes Dauphinoises?", and put the recipe. 5 years later, I got a phone call from one of the support programmers, asking if that was me, as someone had finally bothered reading the help file and come across it. Well, we laughed for a short while, anyway.
Admin
Incidentally, I just remembered another comment I added to another legitimate emoticon in the code: filters.Split(';'); // this Kirby has an electric eel for a mouth!
Wonder how long it'll take someone else to notice that comment... and whether they'll get the nethack reference.
Admin
I've worked at a few places where the last comment makes perfect sense; the only time morale was above sea level was when someone was actively sabotaging the project to make their manager look bad. Leaving problems and kludges for future generations was par for the course, although the passive-aggressive comment really tops it off.
Admin
hehe