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.)
Re:Odd Fascination (Score:2, Insightful)
Re:Odd Fascination (Score:2)
obscure enough for ya?!!! (Score:2, Funny)
//
// 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.
//
//
Re:obscure enough for ya?!!! (Score:2)
Now report to the game grid!
Re:Odd Fascination (Score:5, Funny)
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!
Re:Odd Fascination (Score:2)
I'd like to hear more from commercial developers. Personally, I'm a bit...loose...with my language in my code. If a comment I write helps me understand what I am trying to do and helps other's see what I was up to, I don't really care how it reads.
It's not like the customer will ever see the code, so it may be something that businesses don't really concern themselves with.
Re:Odd Fascination (Score:2, Insightful)
I wonder how many Solaris developers thought that.
Re:Odd Fascination (Score:5, Interesting)
Famous last words?
I'm suddenly reminded of !seineew era sreenigne epacsten!
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.
Re:Odd Fascination (Score:4, Funny)
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.
Re:Odd Fascination (Score:5, Interesting)
Re:Odd Fascination (Score:2)
While my cone has never been subpoena'd it is seen by my end customers. My quotes are rather bland and sparse, though some have a ref# that goes back to my little black book. #F33 is: This is a fucking mess. Don't touch it cause it can only break worse.
-nB
Re:Odd Fascination (Score:2)
You are lucky you weren't bankrupted.
That was a copyright violation and lawyers actually got to look at it. I'm surprised they didn't extend a "little professional curtesy" to Sony's lawyers, or whoever owns of all Carlin's work and inform them of your heinous crime so that they could begin pro$ecut
Re:Odd Fascination (Score:2)
Professionalism aside though its something which can't be tollerated in a commercial environment as very often other depts see the code as well so putting stu
Re:Odd Fascination (Score:2)
grep -rn "shit\|fuck" ./* | awk 'FS="\t" {print $NF}'
variable and function names removed to protect the innocent, guilty and neutral.
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
Re:Odd Fascination (Score:2)
# Oh, but here's fun:
# Due to some sort of gmtime thing, if you specify the last day
# of the quarter as the expiration for kelpie, you'll end up
# with 5pm on the day before as the expiration date. We'll
# tolerate this because
# with and
# day, I suspect someone will read this comment and wa
This commercial developper see shit that makes him (Score:2)
obscene (Okay [name deleted] we'll do it your fuckin' way,)
reflect frustration (I have NO idea what this piece of code is supposed to do or what other events are being kicked inside this 'black box' All I know is that performance sucks.) and (I am deeply ashamed about the structure of this algorithm but the data is coming in this way.) OR
just plain wrong/outdated/unmaintained.
One commment left to me on a piece of unraveled recursive code by a guy I was replacing w
Re:This commercial developper see shit that makes (Score:2)
Re:This commercial developper see shit that makes (Score:2)
HERE BE DRAGONS: xxxx
or:
BITCHES: xxxx
Re:Odd Fascination (Score:2, Interesting)
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
Comparison with Linux (Score:2, Informative)
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.
Re:Comparison with Linux (Score:2, Funny)
Re:Comparison with Linux (Score:2)
Re:Odd Fascination (Score:3, Insightful)
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 se
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.
Grub is a bootloader (Score:3, Insightful)
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:Grub is a bootloader (Score:5, Informative)
Grub loads the OS, but... (Score:2)
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:Grub is a bootloader (Score:2, Informative)
And this coming from the people who gave the world the HME ("Happy Meal Ethernet") network devices?
I guess you're not being too serious.
Re:Grub is a bootloader (Score:2)
Yes, the article considers GRUB only in the context of Open Source code imported into Solaris. Of course, that got lost in the edit summary...
I am vindicated! (Score:3, Interesting)
Re:I am vindicated! (Score:2)
I often make such comments in my source. But mostly they are without spaces or tabs at first character (not indented).
It is more like letting my frustration out and pointing out the badly written or hacked out parts which need redo on a first possible ocassion.
When you browse trough the code the next time you just can't help your self but to notice this.
Re:I am vindicated! (Score:2)
' This code obviously written by monkeys at keyboards. It sucks, it's slow, fix it.
' I wrote this sub in this way because I hate myself. I like build errors, memory leaks, and random crashes.
Nice humour (Score:5, Insightful)
In case anyone was wondering... (Score:3, Informative)
Re:Nice humour (Score:3, Funny)
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 an
Re:As a self-proclaimed expert (Score:3, Insightful)
http://cvs.opensolaris.org/source/search?q=fucking (Score:5, Informative)
http://cvs.opensolaris.org/source/search?q=shit&am (Score:2, Informative)
Re:http://cvs.opensolaris.org/source/search?q=fuck (Score:5, Funny)
10kHz in 1996 (Score:5, Insightful)
'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.
Re:10kHz in 1996 (Score:2)
Re:10kHz in 1996 (Score:3, Funny)
The sad problem is that you are expecting Ziff-Davis writers to have a clue.
Re:10kHz in 1996 (Score:5, Informative)
Re:10kHz in 1996 (Score:2)
-molo
Re:10kHz in 1996 (Score:2)
Re:10kHz in 1996 (Score:3, Informative)
So a rock-solid 100kHz clock is less precise (broader timeslices) but more accurate than a drifty 1MHz clock.
Re:10kHz in 1996 (Score:4, Informative)
Has anyone found ... (Score:5, Insightful)
Re:Has anyone found ... (Score:5, Interesting)
Re:Has anyone found ... (Score:3, Insightful)
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 le
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..).
everyone gets burned (Score:5, Funny)
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.)
Re:everyone gets burned (Score:2)
FUBAR (Score:2)
It is quite helpful really (Score:3, Funny)
Hopefully there's none of this (Score:2, Funny)
my favorite comment (Score:5, Funny)
Comment should read: (Score:2, Funny)
Re:Comment should read: (Score:2)
Deal (Score:2, Funny)
Re:Deal (Score:2)
More checking needed (Score:4, Informative)
embarrasing code.... (Score:5, Funny)
Boy he had some fun at my expense...
A better comment... (Score:2, Funny)
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-shir [thinkgeek.com]
Re:A better comment... (Score:2)
$something = HOOLAPALOOZA_WAS_HERE
(html stuff)
HOOLAPALOOZA_WAS_HERE;
When my boss saw it, he demanded me to change it to the usually boring EOD. Bummer.
Ha, some crazy Perl developers! (Score:2, Funny)
That crazy Larry Wall, always inexplicably quoting Tolkien!
My favourite comment.. (Score:2, Funny)
"Inserted for 2.6 testing - remove before shipping."
People (Score:2, Insightful)
Gordon Matzigkeit? (Score:2)
My favorite solaris comment (Score:2)
I'm Gord... (Score:2)
Another client horror story. (Score:5, Funny)
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.
Do not change this... (Score:2)
ip_ftp_pxy.c [opensolaris.org]
Do not change this to sprintf
Anyone think that some "smart" bloke broke this code at some stage
At least Gord's quote was useful... (Score:3, Insightful)
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!
Don't forget to strip symbols, too! (Score:4, Funny)
Then the customer hooked up a debugger...
Sorry Gord (Score:2)
Your rep wasn't that good to begin with. Ha ha!
from an old linux kernel (Score:2)
kernel: 2.0.38
file:
wow...
Amusing things that frequently end up in my code: (Score:4, Funny)
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.
Re:Amusing things that frequently end up in my cod (Score:3, Funny)
(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.
... recollections ... (Score:2)
There were a couple developers who were no longer at the company who left somewhat monstrous comment blocks of 100 lines or so in the more important sources. These guys had built the framework from the bottom-up and had clearly been asked to explain what was going on to
Source browser in the wrong hands (Score:3, Insightful)
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...
Error handlers (Score:3, Funny)
Censorzilla (Score:4, Interesting)
Re:Is Gord reading Slashdot? (Score:4, Informative)
Re:Is Gord reading Slashdot? (Score:2)
Gordon Matzigkeit , 2000-07-25
Re:GRUB project?? (Score:2)
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.
Re:Oh noes! (Score:2)
Re:Oh noes! (Score:2)
Re:Wow (Score:2)
Assed I can see, but assing?
I guess you could say "This is quite an assing way to do this, but..."
Re:Wow (Score:2)
Re:Wow (Score:3)
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.
Re:Wow (Score:3, Insightful)
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 tha
Re:Who cares? (Score:5, Funny)
Re:haha score one to open source (Score:2)