Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!


Forgot your password?
Programming Sun Microsystems IT Technology

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.'"
This discussion has been archived. No new comments can be posted.

Inside the OpenSolaris Source Code

Comments Filter:
  • by BlogPope ( 886961 ) on Thursday June 16, 2005 @11:49AM (#12832699)
    What's this fascination with dirty words in the code?

    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!

  • by micromuncher ( 171881 ) on Thursday June 16, 2005 @11:54AM (#12832747) Homepage
    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.)
  • by dominux ( 731134 ) on Thursday June 16, 2005 @11:54AM (#12832750) Homepage
    just search for "sucks" and you get a nice list of places to work to make things suck less.
  • Here we retrieve the configuration of the ConfigurationManager. In its configuration, it will find which ConfigurationAgent is defined along with the requiered parameters are requiered to initialize it. The Configurationmanager it self actualy retrieves its configuration by using directely the XMLConfigurationAgent.
  • by Anonymous Coward on Thursday June 16, 2005 @11:56AM (#12832770)

    And I believe that you didn't RTFA. GRUB is included in OpenSolaris.

    I wonder if it's this Gord [actsofgord.com].

  • by k4_pacific ( 736911 ) <{k4_pacific} {at} {yahoo.com}> on Thursday June 16, 2005 @11:57AM (#12832777) Homepage Journal
    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.
  • by CultFigure ( 563155 ) on Thursday June 16, 2005 @11:58AM (#12832787)
    "...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!"
  • Deal (Score:2, Funny)

    by dawnread ( 851254 ) on Thursday June 16, 2005 @12:00PM (#12832795)
    I'll stop using swearwords in my code when my manager stops using ridiculous buzzwords like 'bandwidth' and 'drill down'.
  • by imr ( 106517 ) on Thursday June 16, 2005 @12:02PM (#12832815)
    What's a kernal fuck?
  • by Nutria ( 679911 ) on Thursday June 16, 2005 @12:02PM (#12832816)
    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.
  • by MauMan ( 252382 ) on Thursday June 16, 2005 @12:02PM (#12832818) Homepage
    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...
  • by KingSkippus ( 799657 ) on Thursday June 16, 2005 @12:13PM (#12832893) Homepage Journal

    If I coded closed source software, I think I would probably deliberately load my code up with funnier comments. Something like:

    /* I'm feeling lazy today, so I'll just kludge this for now and let the smart open source people figure out a better way to do it in a few years when it's released. Good luck, guys. */


    /* This is probably a HUGE security hole, but since the software is closed source, security doesn't matter much. */

    or even something corny (a blatant ripoff of a ThinkGeek t-shirt [thinkgeek.com] I have):

    /* Q. What's the difference between dead coders and me? A. 57,004 programmers. */

    Any better suggestions? Reply, because I need something amusing to read this afternoon!

  • by That's Unpossible! ( 722232 ) * on Thursday June 16, 2005 @12:14PM (#12832896)
    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!
  • by rasilon ( 18267 ) on Thursday June 16, 2005 @12:15PM (#12832910) Homepage
    From the Solaris 8 code, it may or may not still be there:
    "Inserted for 2.6 testing - remove before shipping."
  • by Anonymous Coward on Thursday June 16, 2005 @12:20PM (#12832938)
    "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."
  • by Thud457 ( 234763 ) on Thursday June 16, 2005 @12:23PM (#12832959) Homepage Journal
    // 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.
  • by CyricZ ( 887944 ) on Thursday June 16, 2005 @12:30PM (#12833018)
    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.
  • by happymedium ( 861907 ) on Thursday June 16, 2005 @12:44PM (#12833131)
    1782 for (tp = node->tgn_typelist; tp != NULL; tp = tp->tgt_next) {
    1783 if ((kind = mdb_ctf_type_kind(tp->tgt_type)) == CTF_K_UNION) {
    1784 /*
    1785 * Fucking unions...
    1786 */
    1787 found = NULL;
    1788 break;
    1789 }
    Aha! Clearly, Sun programmers oppose organized labor! Such shameless politicking--in code, no less... tsk, tsk...
  • by MynockGuano ( 164259 ) <hyperactiveChipm ... noSpAm.gmail.com> on Thursday June 16, 2005 @12:44PM (#12833142)
    In today's modern galaxy there is of course very little still held to be unspeakable. Many words and expressions which only a matter of decades ago were considered so distastefully explicit that were they to be merely breathed in public, the perpetrator would be shunned, barred from polite society, and in extreme case shot through the lungs, are now thought to be very healthy and proper, and their use in everyday speech is seen as evidence of a well-adjusted, relaxed, and totally un****ed up personality.

    So for instance, when in a recent national speech the Financial Minister of the Royal World Estate of Quarlvista actually dared to say that due to one thing and another and the fact that no one had made any food for a while and the king seemed to have died and that most of the population had been on holiday now for over three years, the economy was now in what he called "one whole joojooflop situation," everyone was so pleased he felt able to come out and say it they quite failed to notice that their five thousand year-old civilization had just collapsed overnight.

    But though even words like joojooflop, swut, and turlingdrome are now perfectly acceptable in common usage there is one word that is still beyond the pale. The concept it embodies is so revolting that the publication or broadcast of the word is utterly forbidden in all parts of the galaxy except one where they don't know what it means. That word is 'belgium' and it is only ever used by loose-tongued people like Zaphod Beeblebrox in situations of dire provocation.
  • At my last job a guy told me the story of a programmer forced to implement some stupid feature due to a customer demand. He made the behavior dependent on a conditional variable named "CustomerIsAnIdiot".

    Then the customer hooked up a debugger...

  • by dasunt ( 249686 ) on Thursday June 16, 2005 @12:59PM (#12833319)

    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?

  • by allanc ( 25681 ) on Thursday June 16, 2005 @01:02PM (#12833360) Homepage
    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. :)
  • by Anonymous Coward on Thursday June 16, 2005 @01:40PM (#12833822)

    c#@!, f$#%

    Are you kidding!?!? Those are my two favorite Perl regex's!

  • by DavidYaw ( 447706 ) on Thursday June 16, 2005 @01:47PM (#12833905) Homepage
    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!
  • by Anonymous Coward on Thursday June 16, 2005 @01:54PM (#12833968)
    196 /* NOTE: In the descriptor writes one _must_ write the address
    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 /* Welcome to Sun Microsystems, can I take your order please? */

    532 /* Would you like fries with that? */

    882 /* Can't happens.... */
    883 printk(KERN_ERR "%s: Aieee, link timer is asleep but we got one anyways!\n",

    915 /* Lettuce, tomato, buggy hardware (no extra charge)? */

    917 printk(KERN_ERR "happy meal: Transceiver BigMac ATTACK!");

    930 /* We have a special on GNU/Viking hardware bugs today. */

    935 /* Will that be all? */

    937 printk(KERN_ERR "happy meal: Receiver BigMac ATTACK!");

    939 /* Don't forget your vik_1137125_wa. Have a nice day. */

    952 /* We're consolidating our STB products, it's your lucky day. */

    957 /* Come back next week when we are "Sun Microelectronics". */

    961 /* Remember: "Different name, same old buggy as shit hardware." */

    1000 /* Shut up the MIF. */

    1017 /* Only Sun can take such nice parts and fuck up the programming interface
    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 /* Originally I used to handle the allocation failure by just giving back just
    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",
  • by Anonymous Coward on Thursday June 16, 2005 @03:08PM (#12834669)
    My clock runs at 1Hz, thank you very much.
  • by sconeu ( 64226 ) on Thursday June 16, 2005 @03:08PM (#12834670) Homepage Journal
    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.
  • by Blakey Rat ( 99501 ) on Thursday June 16, 2005 @04:15PM (#12835338)
    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.

Someone is unenthusiastic about your work.