Slashdot Mirror


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.'"

9 of 338 comments (clear)

  1. Odd Fascination by AKAImBatman · · Score: 4, Interesting

    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.)

    1. Re:Odd Fascination by Chibi+Merrow · · Score: 4, Interesting

      It's not like the customer will ever see the code

      Famous last words?

      I'm suddenly reminded of !seineew era sreenigne epacsten!

      --
      Maxim: People cannot follow directions.
      Increases in truth directly with the length of time spent explaining them
    2. Re:Odd Fascination by utuk99 · · Score: 5, Interesting

      My favorite is I had to write about 50 different modules for a program. So I put a George Carlin quote at the begining of each module from brain droppings. No one except the small group of developers I work with would ever see it right. Unfortunately all of our code got subpoena. They obviously had no idea what the code was doing because out of 10 boxes of printed code, what do you think they had questions about? You guessed it the Carlin Quotes. There were a few sections with things like "Fear ye who enter here!" at the beginning of some really ugly subroutines. Ever since then I have had very innocuous comments in my code. Ok, I at least make them look innocuous to the casual observer.

    3. Re:Odd Fascination by deKernel · · Score: 3, Interesting

      Well, I have been writing software for more years than I want to admit, but here is my take.

      Other than using some terms that are really bad (c#@!, f$#% and such), there is nothing wrong with the developer putting his thoughts in the code. Somethings it will help the next person understand what the developer was thinking.
      I will give you an example. Ugly hacks are bad but sometime necessary. Fact of life. If you have to support someone elses code, you might feel the need to say something bad about the person based upon what see in the code and how they got it to work. If you see comments like "... I realize that this really sucks and a major hack but I it does work..." you most likely will hold off your comments. Its called venting!!!!

    4. Re:Odd Fascination by LittLe3Lue · · Score: 5, Interesting

      !seineew era sreenigne epacsten!

      Translates to (when read backwards): Netscape engineers are weenies!

      Here is the explanation taken from this article:

      Don Rickles apparently writing code at Microsoft:: In the aftermath of Microsoft's admission Friday that its engineers had included a secret password in some of the Web site authoring software shipped with Microsoft's Windows NT operating system -- which The Wall Street Journal claimed could be used to gain unauthorized access to Web sites -- the editor of the Microsoft-software security site NTBugTraq came forward to offer some clarification on the matter. In a message posted to the NTBugTraq mailing list Cooper wrote, "This is a hole that could allow information to be manipulated by others. However, it's limited to 'others' who already have Web authoring permissions on the same box." Cooper added that the secret password in question--"!seineew era sreenigne epacsteN" IE: "Netscape engineers are weenies!" -- wasn't a password at all, but a cypher key which only allows access to the security breach, not the security breach itself. However, over the weekend, two programmers revealed that they were able to disrupt Web servers by exploiting a different vulnerability in the same file. Microsoft confirmed that assertion, indicating that the pair had discovered "a new, separate vulnerability that significantly increases the threat to users of these products" and that "could be used to cause an affected server to crash." (Wall Street Journal story; paid registration required). In any event, when Microsoft issues a patch for this, as it inevitably will, you'll find it here.

  2. Re:Has anyone found ... by mrm677 · · Score: 5, Interesting

    Yes, the locking code in mutex.c is fascinating. They dynamically switch between spin-locks and adaptive backoff locks based on who is running and who is locking what. This is the stuff that makes Solaris scale to dozens of processors out-of-the-box.

  3. Re:Grub is a bootloader by arivanov · · Score: 4, Interesting

    Silliness???

    As far as the kernel is concerned the number of profanities is a clear reflection of the quality of the underlying hardware. One of the things I do before buying new hardware is look at the comments in the linux kernel code. If they are like the ones you meet in the sun** architecture bit (it is the most profane part of the linux kernel) it may be a good idea to stay away.

    For example just read the sunhme.c under drives/net. It is an absolute ROFL. Or arch/sparc/mm/ptrace.c ...

    --
    Baker's Law: Misery no longer loves company. Nowadays it insists on it
    http://www.sigsegv.cx/
  4. Censorzilla by chickenwing · · Score: 3, Interesting

    JWZ has a selection of some of the choice obscenities from Netscape: http://www.jwz.org/doc/censorzilla.html

  5. Re:Has anyone found ... by Paul+Jakma · · Score: 4, Interesting

    the CDDL specifically prohibits me from learning anything from looking at the OpenSolaris code.

    This is untrue and absurd.

    Because its covered by a "file-based" license, I can either take files in full, or not at all.

    This is again untrue.

    The CDDL licence allows you to modify CDDL code, as long as the resulting file is CDDL licenced. So you can take a file, strip out stuff you're not interested in and use that (under the CDDL licence).

    I am not covered by the CDDL (and would be in violation of it) by taking snippets of code from any of the files,

    This is untrue.

    You may take CDDL code and use it as you wish, provided the resulting file is also CDDL licenced. You can have your code link to this CDDL code, and your code can be under whatever licence you like.

    including viewing them and "paraphrasing" what I learn back into my own code.

    Untrue.

    You are allowed to do this, provided that the files which were modifications of CDDL code stay under the CDDL. Your own code you may licence as you wish. If rather you mean that you want to "steal" CDDL code, modify it and bury it in your own proprietary licenced application well, sorry, no, you can't do that - no more than you could with MPL or GPL licenced code.

    Also, there ARE patented concepts in the OpenSolaris code, which you are welcome to use, as long as you use entire files (i.e. covered by the "file-based" license).

    Correct, and you may also modify those files, provided the modified files are made available under the terms of the CDDL.

    I don't want to put any of my clients or projects at risk, so I can't look at the code.

    At risk of what exactly? Your tendencies to want to take other people's code and relicence it? Your email address says '@gnu-designs.com', but I wonder if actually you're a BSD licence fan. :) Note that patents are applicable regardless of whether you have looked at the code implementing them. Even if you don't know about the patent, they still apply. (However, willfully breaking a patent tends to result in higher damages).

    So nope, I haven't even looked at the code, because frankly, I can't, without contaminating my own code and ideas.

    Looking at CDDL code is not going to do that.

    Note that copyright does not disallow you to look and reimplement. Note further that not looking does not protect you against patent claims.

    If you truly were concerned about protecting your clients from patent risks in your own code, then your safest bet would be to take the CDDL code and link to it: with your own code under whatever licence you want, the CDDL code implementing the patent and providing you and your users with a grant to use the patent.

    You havn't fallen for the FUD put about by a certain libc hacker have you? (Who just happens to work for a competitor of Sun's? Pure coincidence of course..).

    --
    I use Friend/Foe + mod-point modifiers as a karma/reputation system.