Inside the OpenSolaris Source Code
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.'"
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!
My other car is a Popemobile
Hasn't everyone been burned by this? And why is it a big deal? It's not like professional developers never curse or get frustrated.
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.)
/\/\icro/\/\uncher
just search for "sucks" and you get a nice list of places to work to make things suck less.
AC's modded -6. I don't see you, I don't mod you, anything you say is lost. Don't like it? Don't be a coward.
And I believe that you didn't RTFA. GRUB is included in OpenSolaris.
I wonder if it's this Gord.
In a piece of C code where I work that has Unicode support, I saw this comment, by itself, within a routine that did some string manipulation: // I'm hot for TCHAR.
Unknown host pong.
"...thank God this code isn't open sourced and linked to slashdot so that every geek can see what a horrible wretch of a coder I am!"
I'll stop using swearwords in my code when my manager stops using ridiculous buzzwords like 'bandwidth' and 'drill down'.
Pay girls to strip!
What's a kernal fuck?
so clearly it's not that clock, it's some other clock.
The sad problem is that you are expecting Ziff-Davis writers to have a clue.
"I don't know, therefore Aliens" Wafflebox1
I remember once when I was was trying to track down a bug I wrote some debugging code which I then commneted out with: #ifdef _SEX_WITH_FARM_ANIMALS_ ...Debugging code... #endif Later, someone wanted to integrate with my code so I saved it off to the interim repository and a few minutes later I got a visit from my co-worker.
Boy he had some fun at my expense...
------- Code to try when you're bored: qsort( 0, UINT_MAX, sizeof( int* ), IntCompare );
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 I have):
Any better suggestions? Reply, because I need something amusing to read this afternoon!
One Perl developer cursed Microsoft... while another inexplicably chose to quote from JRR Tolkien's classic The Lord of the Rings .
That crazy Larry Wall, always inexplicably quoting Tolkien!
Ironically, the word ironically is often used incorrectly.
From the Solaris 8 code, it may or may not still be there:
"Inserted for 2.6 testing - remove before shipping."
"If it was hard to write, it should be hard to read."
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."
//
//
// 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.
//
//
the preceding comment is my own and in no way reflects the opinion of the Joint Chiefs of Staff
I worked at a pretty laid back development firm developing various applications in VB. Well, one of the projects was a school library management system. One of my coworkers was, well, a bit of a freak. He had a strange obsession with penises and boners.
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.
Cyric Zndovzny at your service.
Then the customer hooked up a debugger...
PHEM - party like it's 1997-2003!
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?
1. BHAD ('Breach Hull, All Die'). When I'm writing code that I don't expect other people to use, this is the name I give to error-handling stuff.
:)
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.
c#@!, f$#%
Are you kidding!?!? Those are my two favorite Perl regex's!
There's one thing I love about Visual Basic: "On Error GoTo Hell" is not only valid syntax, but if you make "hell" your error handler everywhere, then "On Error GoTo Hell" becomes a coding standard!
196 /* NOTE: In the descriptor writes one _must_ write the address
/* Welcome to Sun Microsystems, can I take your order please? */
/* Would you like fries with that? */
/* Can't happens.... */
/* Lettuce, tomato, buggy hardware (no extra charge)? */
/* We have a special on GNU/Viking hardware bugs today. */
/* Will that be all? */
/* Don't forget your vik_1137125_wa. Have a nice day. */
/* We're consolidating our STB products, it's your lucky day. */
/* Come back next week when we are "Sun Microelectronics". */
/* Remember: "Different name, same old buggy as shit hardware." */
/* Shut up the MIF. */
/* Only Sun can take such nice parts and fuck up the programming interface
/* Originally I used to handle the allocation failure by just giving back just
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",
My clock runs at 1Hz, thank you very much.
Reminds me of a story my old manager once told me.
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.
General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
Fucking Slashdot can't figure out that not everything in is a link.
(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.
Comment of the year