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.'"
Odd Fascination (Score:4, Interesting)
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.)
I am vindicated! (Score:3, Interesting)
haha score one to open source (Score:0, Interesting)
I always think that peer esteem is one of the biggest contributing factors to the quality of open source code.
Re:Odd Fascination (Score:5, Interesting)
Famous last words?
I'm suddenly reminded of !seineew era sreenigne epacsten!
Re:Odd Fascination (Score:5, Interesting)
Re:Odd Fascination (Score:3, Interesting)
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!!!!
Re:Has anyone found ... (Score:5, Interesting)
Re:Odd Fascination (Score:2, Interesting)
Re:Grub is a bootloader (Score:5, Interesting)
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
Re:Odd Fascination (Score:3, Interesting)
It's kinship. It's a way for programmers to be able to relate to one and other through shared frustrations. It also allows us to get more personal with the code, understand the thinking that went into it, and understand where and why certain features were programmed in certain ways.
And finally, it's about support. "Ok, I'm not the only one who is frustrated." Misery loves company, and sometimes it's nice to know that you're not alone.
Censorzilla (Score:4, Interesting)
Re:Has anyone found ... (Score:3, Interesting)
Unfortunately, I can't. As a Open Source/Free Software author, the CDDL specifically prohibits me from learning anything from looking at the OpenSolaris code.
Because its covered by a "file-based" license, I can either take files in full, or not at all. I am not covered by the CDDL (and would be in violation of it) by taking snippets of code from any of the files, including viewing them and "paraphrasing" what I learn back into my own 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). I don't want to put any of my clients or projects at risk, so I can't look at the code.
So nope, I haven't even looked at the code, because frankly, I can't, without contaminating my own code and ideas.
Re:Odd Fascination (Score:5, Interesting)
Translates to (when read backwards): Netscape engineers are weenies!
Here is the explanation taken from this article [siliconvalley.com]:
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.
Comments are notes... (Score:3, Interesting)
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
Re:Has anyone found ... (Score:5, Interesting)
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.
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..).
Re:10kHz in 1996 (Score:2, Interesting)