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

 



Forgot your password?
typodupeerror
Programming Sun Microsystems IT Technology

Inside the OpenSolaris Source Code 338

Posted by Zonk
from the looking-at-guts dept.
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 Dancin_Santa (265275) <DancinSanta@gmail.com> on Thursday June 16, 2005 @10:48AM (#12832694) Journal
    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.
  • Re:Odd Fascination (Score:2, Insightful)

    by dawnread (851254) on Thursday June 16, 2005 @10:48AM (#12832696)
    Agreed. In my work placements at University I was putting 'funny' comments and debug output in code. I got pulled aside by the manager and told it was definately not on. I thought he was being a bit boring at the time but now looking back I can see it was a geat piece of advice.
  • Nice humour (Score:5, Insightful)

    by moz25 (262020) on Thursday June 16, 2005 @10:49AM (#12832702) Homepage
    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.
  • 10kHz in 1996 (Score:5, Insightful)

    by arete (170676) <areteslashdot2@x i g . net> on Thursday June 16, 2005 @10:53AM (#12832736) Homepage
    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.
  • by ratta (760424) on Thursday June 16, 2005 @10:53AM (#12832742)
    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?
  • Re:Odd Fascination (Score:2, Insightful)

    by Anonymous Coward on Thursday June 16, 2005 @10:55AM (#12832763)
    It's not like the customer will ever see the code, so it may be something that businesses don't really concern themselves with.

    I wonder how many Solaris developers thought that.
  • Re:Who cares? (Score:1, Insightful)

    by Anonymous Coward on Thursday June 16, 2005 @10:58AM (#12832784)
    Us professional programmers care.

    When you are doing a bid do having a conference after winnign one do you sit down and say,

    Yeah, we can code that fucking system no problem. I mean shit man it may be hard as shit but we can meet that deadline. What we need to know is why the fuck did you want that in there. Can't we just get rid of this shit and move this over here. Fuck man, it makes more sense.

    I don't think so. Being a professional means acting like a professional and only adding comments to code that help explain the program.

    Having outsourced HUGE amounts of programming in my life, I can say that finding a comment like "Fuck this a hack." would not be a plus for the vendor in question.
  • by Anonymous Coward on Thursday June 16, 2005 @11:12AM (#12832885)
    Did you RTFA? They're saying OSS is WORSE for profanity and unprofessionalism.
  • People (Score:2, Insightful)

    by sn0wflake (592745) on Thursday June 16, 2005 @11:16AM (#12832914) Homepage
    Could Gord be http://slashdot.org/~Gord [slashdot.org] I wonder.
  • by ArtDent (83554) on Thursday June 16, 2005 @11:43AM (#12833118)

    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:

    // This is an ugly hack.

    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!

  • by ahl_at_sun (853337) on Thursday June 16, 2005 @12:14PM (#12833489) Homepage
    This article has all the sophistication of a 5-year old looking up 'anus' in the OED. Someone already pointed out the confusion between the processor clock and the system clock -- a confusion that would have been avoided if the author had read the code or even the rest of the comments.

    More ludicrous is the author's supposed identification of a Mark Felt lurking in the shadows of the DTrace code:
    The much-vaunted dynamic tracing (dtrace) feature of Sun's system may not be as safe to use as most people think.
    That's based on what? The two ASSERTs that follow the cited comment? This one doesn't go all the way to the top...
  • Re:Odd Fascination (Score:3, Insightful)

    by AnonymousKev (754127) on Thursday June 16, 2005 @12:17PM (#12833517)
    It sounds boring, and it easy to make fun of, but I think (in general) the comments reflect the ability and maturity of the programmer.

    If I'm trying to fix a mess of code and the comment says
    // We're fucked, this shouldn't happen
    My first impression is the coder was an idiot practicing stream of conciousness coding (which is more like typing, really). He's vented and that made him feel better, but it really hasn't helped me at all.

    If the comment over that same code says
    // Bad news. The lock was set, but somehow we're in the think-it's-unlocked section
    My first impression will be much more favorable. The coder has mastered his anger and left me a useful clue to the problem.

    I realize that dozens of "comment f*ckers" will descend and use their rich language skills to correct my misconception. But I've been designing and implementing software for almost three decades now. There are exceptions, but my data points show that profanity never improves the code and leaves an unprofessional appearance. Period.

    I mean, would you hire a carpenter who wrote "F*cking nailgun!" on every 2x4 that gave him a problem? That would be some house.

  • Re:Wow (Score:3, Insightful)

    by mike_the_kid (58164) on Thursday June 16, 2005 @01:15PM (#12834192) Journal
    I've got my list of red flag words in place, but I've been having some pretty serious problems writing an effective filter ... Has it been solved already? Googling for a comprehensive profanity dictionary at work is... tricky.


    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.
  • by surprise_audit (575743) on Thursday June 16, 2005 @05:00PM (#12836399)
    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.
  • by Myopic (18616) on Thursday June 16, 2005 @05:52PM (#12836841)
    kudos. you just outgeeked a lot of us.

"Probably the best operating system in the world is the [operating system] made for the PDP-11 by Bell Laboratories." - Ted Nelson, October 1977

Working...