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.'"
What's this fascination with dirty words in the code? I can't say that I've even considered writing such a thing in commercial code that I write. Unlike OSS code, other coworkers *will* be reading my comments and may not think they're that funny. (Although I love messing with test data. Batman, Picard, Superman, Professor X, Dylan Hunt, etc. are all game. Unfortunately, they all share a phone number with Jenny. Must be one of those antiquated shared lines. ;-))
Perhaps the most telling part of the article is that it's the Open Source code that has the foul language. Which isn't too surprising. If there are no repercussions for such behavior, why wouldn't developers engage in it? But in a straight-laced commerical environment? Unlikely. (Or at least uncommon.)
Javascript + Nintendo DSi = DSiCade
Hardly part of the actual OS.
Sounds like Sun did a bang-up job with their software, reining in the developers under pretty solid coding guidlines. It's the Open Source people who have gone off and sullied the code with their silliness.
Humor in comments is sometimes good. Just not on Slashdot where it only risks your karma.
I write very similar things into my code. My coworker and mentor yells at me about it. I think they're great little bits of levity when your code gets you down.
Don't buy WoW Gold! Make it yourself!
I like the guy's humour. Either that or he is not smart for putting a reputation-ruining 'bomb' in the source code :-) But anyway... good programmers are supposed to be very critical of their code so even functionally correct code can be commented as though it were horrible.
see a Text Widget
yep, no profanity at all
ZDnet seems to want us to think "clock speeds" are at 3 Ghz regarding the following quote:
'Another tried his hand at predicting the future of system speeds. "As of this writing (1996) a clock rate of more than about 10 kHz seems utterly ridiculous, although this observation will no doubt seem quaintly amusing one day," he wrote.'
But in 1996 you had roughly 100Mhz 486s and Pentiums, so clearly it's not that clock, it's some other clock.
Looking for freelance Actionscript (Flash/Flex) or ColdFusion work and/or freelance developers. Email me, put Slashdot
something really interesting in the code, now that Solaris is open? People has been saying "Sun will never open Solaris" for month, now that it is open all that they do is to grep "fuck" or "shit", or look for frustrated comments?
Wondering why i am doing so strange posts? I am trying to get a "+5,Flamebait" or "-1,Insightful" rating.
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.
I'm not going to say whether Linux or Solaris is a better OS. But it seems like the Linux code might be a bit more entertaining to read.
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.
I hear Gord dropped out of the video game store market, and is teaching english in Korea.
"...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!
shit!
Open Source Java Web Forum with LDAP authentication
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 );
yeah, the article actually makes this distinction:
However, the real potty-mouths appeared to be open-source developers whose software made it into the OpenSolaris release in the form of the Perl and GRUB projects.
The summary does not go out of its way to make this clear.
There is much cruelty in the universe, John.
Yeah, we seem to have the tour map.
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!
From the Solaris 8 code, it may or may not still be there:
"Inserted for 2.6 testing - remove before shipping."
Could Gord be http://slashdot.org/~Gord I wonder.
//
//
// 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.
What do you use to scan your code for naughty bits?
Ooooh, hurray hurray for the mod bomb. I think I've finally managed to piss someone off enough to have them burn mod points modding me down. Pretty dumb hobby, dude.
I want a new world. I think this one is broken.
At least Gord's comment gave some indication of what the code was doing.
My pet peeve is a block of utterly inscrutable code, with nothing but the following comment:
Seriously, commenting effectively is *so* simple. If a brief comment neatly sums many lines of code, it's useful. If it explains a subtle interraction with some other bit of code somewhere else, it's useful.
If it points out the blatantly obvious -- yes, ugly hacks are very easy to spot -- don't bother! I don't care that you realize your code is ugly, I just want to start understanding it without reading every line in the project!
...the Gord in question is almost certainly Gordon Matzigkeit. Make of this what you will.
Then the customer hooked up a debugger...
PHEM - party like it's 1997-2003!
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.
More ludicrous is the author's supposed identification of a Mark Felt lurking in the shadows of the DTrace code: That's based on what? The two ASSERTs that follow the cited comment? This one doesn't go all the way to the top...
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!
JWZ has a selection of some of the choice obscenities from Netscape: http://www.jwz.org/doc/censorzilla.html
Yes, the solution is:
Do peer reviews.
There are other benefits, which you can read about in books by the likes of Kent Beck and Martin Fowler. But I'll bet that if you made it a policy to do reviews, and a policy that profanity would not be tolerated, it would clear up sooner than later.
Troll Like a Champion Today
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
Secodn that - shoot for the ideal, knowing full well that the customer will very likely move the goal posts before you're finished, either shortening the deadline and/or insisting on bolt-on extras with no additional time allowed.
And sometimes they are also the place you express the frustration you feel at the particularly dismal piece of architecture someone handed you, that was a poor architecture in the first place and has subsequently been further bastardized into something whose design logic no longer exists in any coherent form, and in which any time you touch the code, there is a decent chance of side effects.
I try not to be profane. If I really want to imply some sort of upset or exclamation, I'll got the old cartoon route of using @#$%^%&!!!!! as a replacement.
But I find people sometimes shy away from identifying poorly architected code, odd inputs our outputs, or places where the approach taken was a kludge that needed to be thrown in but wasn't very good for fear of having an unflattering comment in place. Frankly, I'd rather know about these situations. I'm a big boy... if someone writes that a particular routine is a steaming pile of crap, that won't offend me, as long as the description is technically accurate (the routine actually is) and there is sufficient other data with the comment to tell me WHY this is so.
A co-worker of mine put in this one recently....
<ecode>
' Quick kludge because of time. Should not rely on global structure
</ecode>
Sure, it reveals that we've put a hack in when we should have done it a different way. But at least whoever the next poor bugger that comes along can be 'in the know' and not thinking that we mystically thought this was the 'right' way to solve the problem.
I also like to put in comment tags I can quickly locate in a search (<i>ANAKIN, WORF, BLAKE, GARTH OF IZAR, etc</i>). Sometimes they get left in. Do they cause any grief? Not really. A friend of mine uses the tag <i>WALLY</i> for all of his temporary patches and now this has infested the code bases at at least 4 companies (and other developers use it). You know if you see a <i>WALLY<i> that there is something to pay attention to and usually the note indicates it is a patch, a kludge, or a less than optimal solution.
Other sorts of comments that might not look so good might include:
<ecode>
' [initials_deleted] - [date]
' THIS IS A FIX - we're holding off on implementing it, despite the fact is is the
' correct fix, in order to get the [version] release out the door. Default is [value]. This
' means we are writing the wrong thing into the DB. Yet, at the same time, if we fix
' it now, it means more work to fix and more risk. So, we want to fix it, we want to
' see this change in place, but not right now. So I'm leaving it here, but commented.
'[line of code commented out]
</ecode>
I guess I've written a few comments late at night that I usually excise when the code goes into the repository for the builds. I remember some that crept through. A follow on developer asked me about a comment where I had written "I have no #$%! idea what this value is meant to be so it is utterly arbitrary...." (relating to line discipline for systems we didn't have specs on).
Similarly, I've seen comments like "If you get here, we're TU" (Tits Up).
I have seen supposedly benign test data that was never designed for primetime leak out to customer sites. I've seen error messages that said "You should never see this error message. If you do, you're in a very bad state." pop up at client sites. This kind of stuff happens, so beware that any test data you enter should at the very least not be offensive - funny is okay, but humour can be in the eye of the beholder. I'm sure the [deleted] police agency would have been happy if the easter egg we joked with at the office (an avi of a pig squealing) had actually made it into the final release so that every time someone hit request-to-talk, that noise played on the laptop. Some officers we showed it to broke up laughing, but I'm sure others would have been hugely pissed off. So whenever you do something you don't think will get out, keep in mind, it on
-- Mal: "Well they tell you: never hit a man with a closed fist. But it is, on occasion, hilarious."