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.'"
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.)
Javascript + Nintendo DSi = DSiCade
I believe that has nothing to do with the Solaris code.
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.
I write very similar things into my code. My coworker and mentor yells at me about it. I think they're great little bits of levity when your code gets you down.
Don't buy WoW Gold! Make it yourself!
Code is so much better when your reputation is on the line amongst your peers.
I always think that peer esteem is one of the biggest contributing factors to the quality of open source code.
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.
see a Text Widget
yep, no profanity at all
"Ten million lines of code and not a single profanity? Is that really possible?
Option Explicit
Private Declare Function SetForegroundWindow Lib "SHITHEAD" (ByVal hWnd As _
Long) As Long
Private Declare Function Shell_AssfaceIcon Lib "shell32.dll" Alias _
"Shell_AssfaceIconA" (ByVal dwMessage As Long, lpData As _
NOTIFYICONDATA) As Long
Comments are just that 'comments' who gives a crap if there's curse words or odd stuff? As long as it works and the developer wants to give in insight screw it! If the comments make sense and have some comical/curse words so be it. I rather see code with personality then someone who was straight chalk board.
Line 759 at this link: http://cvs.opensolaris.org/source/xref/usr/src/gru b/grub-0.95/grub/asmstub.c#759
However, it's just GRUB code, so not really part of solaris, just something they've picked up...
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.'"
I believe there is a misquote in there. I coulda sworn he said his reputation would be "gored"..
*ducks*
Before you mod me funny, think, perhaps I was insightfully funny?
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.
Looking for freelance Actionscript (Flash/Flex) or ColdFusion work and/or freelance developers. Email me, put Slashdot
So won't the real Gord please stand up, please stand up, please stand up...
The owls are not what they seem
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?
Wondering why i am doing so strange posts? I am trying to get a "+5,Flamebait" or "-1,Insightful" rating.
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.)
/\/\icro/\/\uncher
because of some "insightful" managers? of course you'll appologize to the future generations for the hack... this is what I was tought at least, at JayLeno's Fruitcake Lady (I'm not sure which one is the first name)...
I had another sig before, but this one is better
just search for "sucks" and you get a nice list of places to work to make things suck less.
How long until we start seeing features being ported over from OpenSolaris to Linux? Will it happen?
---
European zine about guns, hacking, paranoia
#eurohacker@irc.freenode.org
AC's modded -6. I don't see you, I don't mod you, anything you say is lost. Don't like it? Don't be a coward.
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.
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.
Unknown host pong.
"...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!"
I'll stop using swearwords in my code when my manager stops using ridiculous buzzwords like 'bandwidth' and 'drill down'.
Pay girls to strip!
shit!
Open Source Java Web Forum with LDAP authentication
I wish I had mod points right now, but parent has the truth about Grub.
"When the only tool you own is a hammer, every problem begins to resemble a nail." - Abraham Maslow (1908-1970)
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...
------- Code to try when you're bored: qsort( 0, UINT_MAX, sizeof( int* ), IntCompare );
Good job guys...
He tried to kill me with a forklift!
49 #undef P0_WA /* that shit not done here! */
d /volmgt/vold/dev_rmscsi.c#63
http://cvs.opensolaris.org/source/xref/usr/src/cm
CRINGE. The comments in the code are:
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 was: (If you get to debug this piece of shit, good luck. I'm gone now. Guess why?)
Documentation by osmosis is common in all in-house development efforts, as is profanity.
MSBPodcast.com The opinions expressed here are my own. If you don't like 'em... Think up your own stuff.
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-shirt I have):
Any better suggestions? Reply, because I need something amusing to read this afternoon!
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!
Ironically, the word ironically is often used incorrectly.
It comes down to: inflected forms and naughty words in other words. For instance if I search for "ass" then I can either have it match too strictly and it will catch "class" and "passed" -- or too loosely and it will not catch "dumbass" and "jackass". Then think of all the -ed and -ing formations and it starts to become more and more of a tricky problem.
Has it been solved already? Googling for a comprehensive profanity dictionary at work is... tricky.
I want a new world. I think this one is broken.
From the Solaris 8 code, it may or may not still be there:
"Inserted for 2.6 testing - remove before shipping."
How do you install it? Do you think they're going to use Linux or the Hurd to install GRUB on a pure Solaris system?
Could Gord be http://slashdot.org/~Gord I wonder.
"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."
I believe it's Gordon Matzigkeit. He worked on GNU Hurd, and the only bootloader supporting GNU Hurd is GNU Grub.
//
//
// 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.
//
//
the preceding comment is my own and in no way reflects the opinion of the Joint Chiefs of Staff
well, entertained me.
I had to debug some code from another developer who must have been watching the Scooby Doo movies at the time of development. Most of the comments/errors started as "Ruh Roh Shaggy" + an error statement. Not a profanity by any means, but still not something you'd want a potential customer to see during a demo.
The only reason anybody complains about foul language is to send a message to other ppl that "Well, /I/ would never say such a thing..."
It just doesn't go over well to constantly go around reminding everybody what a considerate wonderful person your are so ppl become creative. It's like the bitches that always loudly complain about being hit on, because nobody wants to listen to them bragging about how beautiful and desirable they are so they have to find another way.
Personally, I could give a fuck less how anal retentive ppl are or how much they like to suck up to non-coders standards.
I was just reminded of the time not too long ago when we were upgrading our systems from (then) SUNOS to SOLARIS. A mildly frustrating experience! We came up with the acronym: Sh*t Out of Luck And Rational Intelligent Solutions.
...the right of the people to keep and arm bears shall not be infringed.
...you insensitive clod.
War doesn't prove who's right, just who's left.
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.
Cyric Zndovzny at your service.
Rather than information about the frequency of profanities in the source code, I'd like to know whether the Solaris release is reasonably complete and open now. Has anybody actually succeeded in downloading, compiling, and running it? What's the FSF's take on the license?
yeah, to make something jump out I either use:
HERE BE DRAGONS: xxxx
or:
BITCHES: xxxx
DO NOT DISTURB THE SE
To: MCP Engineering Team
Please be aware that the MCP coding standards have been updated to reflect appropriate actions regarding recent customer complaints of run-on output. Any output strings that are also final clauses shall be terminated with "EOL".
Please update all existing clauses and as well as apply to any new code.
END OF LINE
Is always worth a search.... my favourite was this one
:)
ip_ftp_pxy.c
Do not change this to sprintf
Anyone think that some "smart" bloke broke this code at some stage
An Eye for an Eye will make the whole world blind - Gandhi
1. Linux has profanity and Open Solaris is considered a 'competitor'. By not having profanity in it, Open Solaris may be seen as 'more professional'.
2. Any profanity in the source at the time Sun opened it reflects on Sun the company.
Personally, I could give a rat's ass.
Chips from Sun were ... and remain ... s l o w.
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!
while not exactly a profanity, still good for a laugh. specially the "security crap" remark.
Well, Sun is not the primary sponsor of Grub.
Because of this, if the Grub source has profanity in it, it should not matter. Grub is the boot loader and was not used in previous closed source versions of Solaris.
(Grub, btw, rocks.)
I work for a French company and we see this alot in the code:
"putain de merde"
which means,
"shitty whore"...
...the Gord in question is almost certainly Gordon Matzigkeit. Make of this what you will.
Looks like your input has triggered some long dormant debugging code...
Bow down and worship my 'l33t unpr0f35510n41 c0mm3nt1n9 5tyl3!!!
pleeeeeeease?!!!!!
"The most embarassing comment came from a developer of the GRUB project who went only by the name of "Gord"."
It didn't strike me as being embarassing. Just sarcastic.
Then the customer hooked up a debugger...
PHEM - party like it's 1997-2003!
Thank God nobody's looking at this comment, or my reputation would be ruined.
Your rep wasn't that good to begin with. Ha ha!
Dedicated Cthulhu Cultist since 4523 BC.
printk("ufs_read_super: fucking Sun blows me\n");
/usr/src/linux/fs/ufs/ufs_super.c
kernel: 2.0.38
file:
wow...
--
"It is now safe to switch off your computer."
As I've mentioned here and here!
"Ein Volk, ein Reich, ein Führer." -Adolf Hitler
"We are one Nation, we are one People." -The One 'leader'
I think this is my favorite function name.
/\/\icro/\/\uncher
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.
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 a great many newcomers.
The comments read like fairy tales, featuring the exploits of the data structures and objects in anthropomorphic terms. (One was something like "Ten Little Endians and their Big Brothers".) It actually helped me a great deal in understanding what was going on. I felt as if I had uncovered a marvelous little secret. (Gosh, I wish I'd made copies of some of them, because they were wildly entertaining.)
Every now and again I'd ask some of the longtime pros about these guys who left the great narrative comments behind, figuring that they must have been very outgoing and lighthearted guys. More often than not, I'd find out that these were the quiet unassuming old-guy types that didn't suffer fools lightly. The comments gave an entirely different impression.
None of it was especially dirty or nasty or foul, but I've never seen anything like it since, which leads me to believe that the lengthy amusing and informative comment block has become unpopular, or maybe just squashed in code review.
.. pa-ra-bo-la, pa-ra-bo-la, 2 pi R, 2 pi R, where's your latus rectum, where's your latus rectum, 2 pi R
GREAT job...
~You laugh because I'm different, I laugh because I'm insane~
I particularly like the variable defined as "int n_pissed_on;" in usr/src/cmd/sgs/error/common/errortouch.c, which is apparently a counter for the number of files touched. ;)
"Ein Volk, ein Reich, ein Führer." -Adolf Hitler
"We are one Nation, we are one People." -The One 'leader'
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...
That would be SunOS, the predecessor to Solaris. Some of the original BSD authors wrote SunOS (and were among the founders of Sun?), so it is not a ripoff.
I remember when I was doing some temp coding at this one place, and we had to basically create a whole bunch of GUI stuff by overloading this base class for buttons that the main guy had wrote. Now, if you didn't change the label on the button it said "Click on me".
Being the rascally weasel I am, I opened up the main source tree and changed the default text to "Click on the Monkey Butler" and recompiled it. Needless to say, someone forgot to change the default text....and hilarity ensued. I tried not to laugh too hard, fearing it would give me away. But, damn, that was funny.
click me
maybe not have profanities, but try this search of solaris code: http://cvs.opensolaris.org/source/search?q=%22micr osoft+corporation%22&defs=&refs=&path=&hist=
Well, I have been writing software for more years than I want to admit, but here is my take.
.. what's the point ? Do you really think it's a long run compared to others .. hehe ..
Ok, so you were programming for what 10-15 years
http://cvs.opensolaris.org/source/search?q=ass&def s=&refs=&path=&hist=
- Moomin
When i worked at a large corporate we used to personify pieces of code. Our principle engineer would supply a set of cartoon characters to go along with the particularly nasty bits.
//Cleanup in case BPF came in here and shat all over the floor
//Just because i did this doesn't mean it's not a bad idea
This would lead to comments like
I've always been fairly reserved in my comments, but it's always nice to add things like
Actually in a small laid back company i'm more careful than in the straight-laced commerical environment since i know that my bosses can and do actually look at code.
But more than 50% of moderators it would appear.
I guess Sun will stay on good terms with Profanity Blacklist, unlike me.
--
WHO ATE MY BREAKFAST PANTS?
I'm Gord!
But they gotta pay. Giggity giggity!
311 Debug.info("HELP: Looking for a");
312 BST result = bst.find_tree("a", false);
313 result.traverse_find("a");
314
315 Debug.info("HELP: Looking for as");
316 result = result.find_tree("as", false);
317 result.traverse_find("as");
318
319 Debug.info("HELP: Looking for ass");
320 result = result.find_tree("ass", false);
321 result.traverse_find("ass");
http://cvs.opensolaris.org/source/search?q=ass&de
I don't see how any of the comments mentioned are worth an article at all. I mean comments are interesting pretty much only to other programmers, who can empathise or criticise, or otherwise get in the head-space of the original writer. As a study of a cultural niche, they might be interesting.
But the article's example comments are not even worth commenting on.
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!
No, wait, that's a fucked kernel.
Sorry, my bad
I usually put "Reactor exploded. Core melt down imminent. Repent your sins." as the description for errors that should never ever come up. And I name variables that most people won't see as concatenations of cursewords (why use one, when two can be twice as effective?). crapfuck is my current fav.
infact i swear and use naughty imagery in my variable and function names and comments pretty often. QA doesn't compain so much. but coworkers think that someday, somewhere, someone might be offended. i say fuck em. fuck em with a big rubber dildo. break it off inside their ass and beat em with the end of it.
I wish that I was a catfish.
JWZ has a selection of some of the choice obscenities from Netscape: http://www.jwz.org/doc/censorzilla.html
50% of the population is below average
well, duh....
Thanks for letting us know which side of the average you are on.
Well, remember, for the most part these are the same developers who wrote the all time best bug reports ever:
4256482 Banging on keyboard like a wild monkey during cde startup causes dtwm hang
4338420 cron is vulnerable to murder by its children
and my personal favorite
4110503 as_setprot heuristic gave my process a wedgie.
Envy my 5 digit Slashdot User ID!
http://cvs.opensolaris.org/source/search?q=god
-- All Gods were immortal.
-- S. Lem
This is no insult to the programmer, however, as only an idiot penalized a person for not doing more than they physically could.
Nor is it an insult on perfection, however, as the ideal is to have a solid design that won't crumble in the event of the unexpected.
Since we're using quotes, I'll use this one: "If you shoot for the moon and miss, you'll still end up amongst the stars." In other words, provided you approach "perfection" with the understanding that you may not reach it and therefore take that into account, you will end up with a "good enough" solution.
The problem is when people aim for "good enough" and miss. They don't have any leeway available to them, and there's no fallback they can use.
Perfection is near-enough unattainable. I once worked out how much it would cost to "clean" the Linux kernel to the point where it could be mathematically proven to be bug-free. It's somewhere in the region of a billion US dollars, at current pay rates, assuming that code can be proven significantly faster than it can be developed, and I would guess a team of about eight thousand programmers a year to complete.
This is a finite quantity, so it is clearly "possible". Personally, I wouldn't want to be the CEO of a company that actually tried to do this. I'd be lynched.
The sensible course, then, is to shoot for the ideal in the knowledge that missing is not merely possible but actually a near-certainty. Specify as best you can, design as best you can, implement as best you can. Flaws will exist, but they can be localized. They don't have to seriously screw everything up.
The other element is to use copious trapping. Check return codes, catch signals, trap exceptions, do anything the language allows you o do to gracefully handle conditions that should not arise. That way, when bugs do creep in, you can prevent them from unduly impacting the rest of the code. This can be in the form of debugging, but it can equally well be in the form of workarounds and data massaging. All it has to do is turn an invalid state into a valid one.
It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
That's right sir:
http://cvs.opensolaris.org/source/search?q=ass
Is it me or does the woman in the pic on that site look a lot like Kwan Boa?
I am trolling
In real life carpentry, the carpenter says fucking nailgun even if it is working, and he stops every 15 minutes to snort some more cocaine or drink another beer. (when you work on a union job you can afford cocaine, non-union is beer)
I like to use the term "This is not Scottish"
and we all know, if its not scottish, ITS CRAP!
I, a lousy programmer (I'm worse now), had to go through his code looking for comments and clues as to what he was trying to accomplish with his code, augment the comments where I could, and make an effort to identify the various modules and functions. Then I had to turn my results over to the dead guy's replacement ... my work was to give the new programmer (a more expensive contractor) a head start on finishing the code.
It was a wasted effort for me: he had a lot of profane "venting", some pr0no fantasies, and little useful information to help decipher what each chunk of code did.
We had a new industrial control product (hardware boxes and a GUI running on a PC) which we had to demo at a big trade show. The team hacked away until the last possible moment and then I got to drive the stuff overnight to Chicago (600 miles).
... except the message window filled up with "The little piece of code that's never supposed to execute just executed!" - probably about five a second scrolling continuously off the top of the window.
We got there, set it up and it worked fine
By strategically placing a graphical window over the top of the message window, we got away with the demo, but "clever" error messages were frowned on from then on.
Look, it's trying to think - Albert Rosenfield
Comments make fun reading...
From a GPS project:
"Tracker Manager: Like all managers this manager sits around doing nothing until something works then it screws it up"
Another one from the kalman filter: "This is a kalman filter but not as we know it Jim" (This Kalman filter did bugger all a KF should do)
yes, I meant to mount the cunt that counts. What's the amount? Put it on my account.
That's the name The SUN PR machine goes by is it?
Editors, can we please have less OpenSolaris propaganda and more about OS's people are actually using.
It's not like anyone sees comments in the source code. I, on the other hand, prefer to have my profanity appear in my error messages: when the user's a fucking idiot, I tell him, and make sure he doesn't do that again.
Just thought a Cursory search for profanity was funny....
Huh? They had 200 MEGAherz machines in 1996... what was this person talking about?
- First they ignore you, then they laugh at you, then ???, then profit.
Crow: "Whoa, I didn't expect this. Could somebody hand me my notes?"
Crow: "Oh, look, there it is. Breach hull, all die... even had it underlined!"
Haha, funny ass show/movie.
Comment of the year
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.
Comment of the year
For some internal data collection programs, I used to write similar messages to code I was 99.99% sure would never be run. I don't recall anyone ever actually seeing it run so I guess I was OK. IIRC, the output went something like "Bad things happening here - ". The code never repeated the message though, it would just end the application after the user clicked "OK".
What rulez?
Hint: It's in MM_MacOS.pm. Therefore, Mac rulez!
p.s. Dear Solaris, L33tsp3ak is unprofessional.
Is 'crap' not at all profane?
http://cvs.opensolaris.org/source/search?q=crap
What about this?
http://cvs.opensolaris.org/source/search?q=shit
or:
http://cvs.opensolaris.org/source/search?q=bitch
http://cvs.opensolaris.org/source/search?q=pie
Whooops. Should've checked my typing on the title. ;-)
I am no longer wasting my time with slashdot
Stolen from some web page I just googled:
That might have been the 4K paper tape typesetting program.
4K because it ran in 4K words of PDP-8. It was all in assembler of
course, heavily self modifying as was the fashion in those days. There
was only one comment line in the whole 4 inch stack of listing and no
documentation.
I remember the comment line to this day "/RIP LVB"
I think the contents of the instruction equated to the year that
Beethoven died. I guess the author was making a point. Bastard!
The damn thing was dumped on me when I first joined DEC as a cocky
little brat.
Those who live in glass houses shouldn't throw stones.
Occasionally, the reaction is the opposite. /etc, sometimes causing a situation where the system never fully booted. I had to create a small script to be run during init which looked for this condition and fixed it. I called this script $PRODUCTNAME_Unfuck. Every bootup, you'd end up seeing $PRODUCTNAME_Unfuck [OK] printed during the boot process.
During the testing phase of a project I was working on as a consultant, the single closed-source product involved was the one causing the most trouble, and one problem was that it kept messing with a certain file in
Eventually I managed to get $BIG_SOFTWARE_COMPANY to fix the bug in $PRODUCTNAME, and the patches got applied, and the insultingly named little script was no longer necessary.
However, when I visited the customer, long after the project was finished and taken into production, I witnessed $PRODUCTNAME_Unfuck [OK] pop past as one of the systems booted. Turned out that due to still being not-exactly-happy with $COMPANY or $PRODUCTNAME (there had been plenty of other problems) my clients had left the script in (it was basically a NOOP at this point since the error was fixed) simply because they wanted to needle $COMPANY's consultants when they visited. I thought it was pretty funny.
Writing some complex and large CMS/workflow applcations for a large (very large) financial instritute somewhere in europe I recall one meeting in the plush and trendy meeting room, we were all happy, and a newly mastered release (only a 0.6 probably) with a whole 2 stright no holidays of work on it, was about to head off to a courier.
//AUTHOR: Doesn't work? //AUTHOR: removed lines to fix //AUTHOR: seems to be working????
Great. In comes the comical yet lovable scottish boss (not in scotland) who stars talking a non-english lanuage, fires up xemacs (through cygwin) on the projector computer, does some home magic, and runs a script with some grep on the code (Java).
Ensuing hilarity as the page floods with multi-lingual obscenities. A quick -10n hack and we had a rough count attributed to each person. The skin head in the metal-band-of-your-choice-T's face lit up as he was exponentially above the rest.
The female developers were a bit shy in the fact that they hadn't gotten away scot free.
We grabbed the CD from the courier, and ceremonially broke it up.
It was to be sent to a code integration review, and well... you know... (maybe you had to be there - imagine 20 techies around a... round table... late on a Thursday - right laughs I tell you)
So, what have we learnt? DOCUMENTING CODE IS BAD! I know some people actually believe that, they say the method names should be well structured, and each method very atomic, so you do not need MUCH comments (but def some).
About going back to code as little as 3 weeks later, seeing some lines of code with comments, homing in to remember what was happening at this place, and then seeing the helpful:
yeah... so helpful... seemed easy at the time. But what it shows is, some of these 'wtf?' comments are now null and void, because pruning old traces/comments is the most arduous task of a programmer. it compiles, runs, closes without bombing, ship it already!
#hostfile 0.0.0.0 primidi.com 0.0.0.0 www.primidi.com 0.0.0.0 radio.weblogs.com
At Burroughs, the B5000-6000 series had hardware memory descriptors to manage memory segments. Each descriptor had a primary instance called the mother descriptor. They also had way of making new processes call forking. You know where this is going... The process that made primary instances of a mother descriptor was called the motherforker. (I don't remember exactly how it was spelled.)
These were the days when many computer centers had on site software and hardware support, and there were hard copies of the operating system, in this case the Master Control Program, on site. Well, one day a customer found out about this procedure and the word came down from On High: no more suggestive names or comments in the code!
On the Cray we were using Fortran and assembly. The machine did not have virtual memory and the Fortran system had overlays, where you could manually control what part of the code was in memory. We were doing very complex overlay management, and at one point we got this error message from the overlay manager: STOP: DAMN.
Fortran had a STOP command with a single argument, and if you gave it a number it would print the number when it stopped. You could also give it a string constant of up to 8 characters and it would print that when it stopped. We contacted Cray, and it turned out that the overlay code was written in Fortran. We actually talked to the guy who wrote the code, and he told us that he knew that this situation could come up, but he didn't know what to do about it. He just put in a STOP command and hoped that it would never happen. Well, it did happen, and he went back and fixed the problem. As far as I know there were no negative reports to anyone in his chain of command.
Wouldn't that set a precedent that code is art rather than device? Maybe the OS community should try and cause such a trial...
And sometimes they are also the place you express the frustration you feel at the particularly dismal piece of architecture someone handed you, that was a poor architecture in the first place and has subsequently been further bastardized into something whose design logic no longer exists in any coherent form, and in which any time you touch the code, there is a decent chance of side effects.
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
-- Mal: "Well they tell you: never hit a man with a closed fist. But it is, on occasion, hilarious."
http://sunsolve.sun.com/search/document.do?assetke y=urn:cds:docid:1-1-4256482-1
Work Around:
Don't bang on the keyboard like a wild monkey
I looked at the binary archive and couldnt make sense of what those bits actually DO :(
Any people more knowledgable about solaris want to chime in? It looks like probobly most of the code missing is either "stuff they dont own 100%" (e.g. drivers which was mentioned elsewhere) or "encryption bits" (although I cant see the issue with releasing the encryption bits, I doubt that there is 3rd party code in EVERY encryption related binary)
One of the snippets in the article refers to a supposedly alarming comment in dtrace.
The author of the comment has explained(*) it in his blog.
(*) explained in a way that probably only makes sense to hardware/assembly geeks. (i.e. Not me)
Read more of this story at Slashdot.Read more of this story at Slashdot.Read more of this story at Slashdot.
At the time of release, the encryption bits were covered under export law. Now that the code is open source, the crypto stuff can be opened.
It's in the roadmap to be release within 3 months.
It will not happen. Sun's license (CDDL) may be OSI approved, but it is not GPL compatible. Sun's code cannot be directly ported into Linux.