Inside the OpenSolaris Source Code 338
An anonymous reader writes "Ten million lines of code and not a single profanity? Is that really possible? Apparently, yes, says OpenSolaris community manager Jim Grisanzio. He said even before Sun filtered the code, it was relatively free of profanity. 'They went through the code for a great many things,' he said, 'and I'm sure they cleaned a word or two. Or three.' But a careful look through the code will reveal some programmers' frustration." From the article: "The most embarassing comment came from a developer of the GRUB project who went only by the name of 'Gord'. 'This function is truly horrid,' he wrote. 'We try opening the device, then severely abuse the GEOMETRY->flags field to pass a file descriptor to biosdisk. Thank God nobody's looking at this comment, or my reputation would be ruined.'"
Re:Odd Fascination (Score:5, Funny)
The code might be compiled and run on some unsuspecting souls computer. Once the computer learns that kind of language, the next thing you know it will be downloading porn!
I should know, that how it got on my computer!
everyone gets burned (Score:5, Funny)
It is worse when questionable things get present to end users and/or clients. In a UI demonstration of an accounting project, I had a button called "Do Me". It didn't go over so well. But somehow it came out that one of the underlying combo boxes was called "ViagraComboBox" because it outperformed... that didn't go so well. So now all my code is antiseptic, just because its not good to show "unprofessionalism" infront of the client.
The worst thing I've ever heard was a friend gave a demo of a pipeline monitoring application to a client. During the course of a demo, a pumping station turned red to show an alarm, followed by a small mushroom cloud animation... suffices to say the client walked out of the meeting. (But hey, he now works at Microsoft.)
It is quite helpful really (Score:3, Funny)
Hopefully there's none of this (Score:2, Funny)
Re:GRUB project?? (Score:0, Funny)
And I believe that you didn't RTFA. GRUB is included in OpenSolaris.
I wonder if it's this Gord [actsofgord.com].
my favorite comment (Score:5, Funny)
Comment should read: (Score:2, Funny)
Deal (Score:2, Funny)
Re:Comparison with Linux (Score:2, Funny)
Re:10kHz in 1996 (Score:3, Funny)
The sad problem is that you are expecting Ziff-Davis writers to have a clue.
embarrasing code.... (Score:5, Funny)
Boy he had some fun at my expense...
A better comment... (Score:2, Funny)
If I coded closed source software, I think I would probably deliberately load my code up with funnier comments. Something like:
or...
or even something corny (a blatant ripoff of a ThinkGeek t-shirt [thinkgeek.com] I have):
Any better suggestions? Reply, because I need something amusing to read this afternoon!
Ha, some crazy Perl developers! (Score:2, Funny)
That crazy Larry Wall, always inexplicably quoting Tolkien!
My favourite comment.. (Score:2, Funny)
"Inserted for 2.6 testing - remove before shipping."
Comments are for cowards, anyway (Score:1, Funny)
My co-workers are lucky I even bother to use descriptive variable names. That's a huge improvement over my last reviewing quarter, when I started with variable a and worked to z, then started with aa, ab, ac, etc.
Occassionaly I'll put a comment like this in the header:
"If you're reading this, you have failed in some way to get the code I wrote to do what you wanted it to. Obviously, this is your failure, not mine, so close your editor and figure out what you did wrong."
obscure enough for ya?!!! (Score:2, Funny)
//
// SPACE PARANOIDS v 0.9.3
// Kevin J Flynn
// June 5, 1982
//
//Watch, I bet that weasel Ed Dillinger will like totally rip-off this program.
//
//
Another client horror story. (Score:5, Funny)
One of his jokes was to attach code to a button that would make an animation of a penis erecting and ejaculating appear, but only after every 7 or 8 clicks of that button. Normally he would only keep such code in for a day or so, until somebody in QA ran across it.
Anyway, at one point we were at a conference of school librarians demoing our product to them. Things were going well, until we clicked on a button, and up on the large screen came an animation of an erect penis ejaculating. Needless to say, we were quite embarrassed! I don't think he was with the company much after that.
Re:http://cvs.opensolaris.org/source/search?q=fuck (Score:5, Funny)
Re:Who cares? (Score:5, Funny)
Don't forget to strip symbols, too! (Score:4, Funny)
Then the customer hooked up a debugger...
Re:Nice humour (Score:3, Funny)
I'm not a professional programmer (far from it), and I'm not trying to pass off the impression that I'm speaking from an expert's point of view.
However, a nice quote that I've heard is "Perfect is the enemy of 'good enough'", which has more than a bit of truth to it. I've painted myself into coding corners before, and I've had ugly hacks to get out of it. I've included a fair number of comments such as "/* TODO: this is unmaintainable */". But the code, while ugly, works. Moreso, it works without any noticable bugs being discovered.
In such a situation, I sit back and consider the following: the 'correct' solution takes time, takes energy, and probably will need to be debugged. The "horror-from-the-deep" implimentation is working. Therefore, until I'm ready to extend the code, I'm willing to let the ugly solution stay in the code.
I know this isn't the "correct" way to code. I should have the right solution the first time (according to certain self-proclaimed experts). There is also the cries from the refactoring crowd, which tell me to rewrite the bad code to "fix" it. But lets be honest -- the hideous code is already debugged. It works. It may not be perfect, but its good enough for now.
Later, when I go to extend the functionality of bits of code, the ugly hack tends to be written out. In that case, the obscure bits of ugly code that weren't touched after the day it was debugged stays in. The ugly code which needs to be extended and deal with strange and weird cases gets rewritten into something more robust and readable.
In short: Its often not worth investing time to "fix" working bad code that is infrequently used and/or extended. The current code should be debugged. The new code won't be. Why encourage bugs?
Amusing things that frequently end up in my code: (Score:4, Funny)
2. "OH MY GOD BEAR IS DRIVING CAR!" is how I tend to label code that should Never Happen. I was working as a contractor at my current company and this ended up in some of my code. After they decided to hire me on as a full time employee, my boss mentioned that this comment was one of the primary factors in that decision. It's good to work for a company with a good sense of humor.
Re:Odd Fascination (Score:2, Funny)
c#@!, f$#%
Are you kidding!?!? Those are my two favorite Perl regex's!
Error handlers (Score:3, Funny)
Re:Grub is a bootloader (Score:1, Funny)
197 * member _first_. The card must not be allowed to see
198 * the updated descriptor flags until the address is
199 * correct. I've added a write memory barrier between
200 * the two stores so that I can sleep well at night... -DaveM
528
532
882
883 printk(KERN_ERR "%s: Aieee, link timer is asleep but we got one anyways!\n",
915
917 printk(KERN_ERR "happy meal: Transceiver BigMac ATTACK!");
930
935
937 printk(KERN_ERR "happy meal: Receiver BigMac ATTACK!");
939
952
957
961
1000
1017
1018 * like this. Good job guys...
1733 static void happy_meal_set_initial_advertisement(struct happy_meal *hp)
1793 static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status)
2001
2002 * that one ring buffer to the happy meal. Problem is that usually when that
2003 * condition is triggered, the happy meal expects you to do something reasonable
2004 * with all of the packets it has DMA'd in. So now I just drop the entire
2005 * ring when we cannot get a new skb and give them all back to the happy meal,
2006 * maybe things will be "happier" now.
2215 printk(KERN_ERR "happy_meal(SBUS): Can't order irq %s to go.\n",
Re:10kHz in 1996 (Score:2, Funny)
Re:Odd Fascination (Score:4, Funny)
He was writing some artillery control software, and written a Fire Unit Check routine. He didn't even consider the acronym. Needless to say, at the code review, it got changed.
Re:Amusing things that frequently end up in my cod (Score:3, Funny)
(Crow breaks through hull of Satellite of Love, air begins rushing out into space)
Crow: "Whoa, I didn't expect this. Could somebody hand me my notes?"
(Wind blows Crow's notes onto his face, sticking it there)
Crow: "Oh, look, there it is. Breach hull, all die... even had it underlined!"
Haha, funny ass show/movie.