Linux Kernel Code Humor 502
An anonymous reader writes "This article points to some pretty funny comments and code in the Linux kernel. From colorful metaphors, to burning printers, to happy meals... A recursive search through the entire code base reveals some interesting language. Is all code like this?"
Is all code like this? (Score:5, Funny)
Haven't been working long in the real world, eh?
Re:Is all code like this? (Score:3, Informative)
Re:Is all code like this? (Score:3, Funny)
Re:Is all code like this? (Score:3, Insightful)
Re:Is all code like this? (Score:5, Funny)
Re:Is all code like this? (Score:4, Funny)
Re:Is all code like this? (Score:4, Funny)
Well, the file got propogated to other trees before he could "correct" the button, and during pre-release testing a volunteer was playing the game and lo! the button pops up.
-FF
Re:Is all code like this? (Score:3, Insightful)
Humor can co-exist with professionalism. However, source code is not where you put it. If you ever release that code to a customer, it could damage your company's reputation. Too many such comments could interfere with efforts to search the source code. Humor also often language- and culture-dependent, so your company's foreign employees may even misunderstand subtle jokes as actual useful comments about the code. And then it's no longer funny.
Not to say that many such coding standards are little more than power trips. However, a professional will always keep in mind the fact that the source code doesn't belong to him or her. If you don't like the rules set by your employer, find another job.
Yes. (Score:5, Funny)
Re:Yes. (Score:5, Funny)
warning: why does this work?
a grrl & her server [danamania.com]
We need more comments like this! (Score:5, Interesting)
It's rare, thankfully, but it is possible for code to trigger obscure compiler or even CPU bugs. These can be virtually impossible to track down, esp. if your boss is (justifiably) skeptical of your claim that the problem has to be in the compiler. In these cases the best you can do is flag the code as something that's very flaky.
(BTW, I have some personal experience with such code. I just hit one with a PNG decoder - one mode had a rare decoder error that would flip one pixel, but the mode meant that the error was propagated across multiple scan lines. A very careful review of the code showed no error, and when I tested the code on different hardware (a PC, not an embedded device) it worked perfectly on the same images. Therefore it has to be the cross-compiler or hardware, and all I could do was document the problem.)
Re:Yes. (Score:5, Funny)
Re:Yes. (Score:3, Funny)
I'm sure my TA found it rather humorous...
The Tao of Linux (Score:5, Funny)
If the Tao is great, then the box is stable. If the box is stable, then the server is secure. If the server is secure, then the data is safe. If the data is safe, then the users are happy.
In the beginning there was chaos in Unix.
Tanenbaum gave birth to MINIX. MINIX did not have the Tao.
MINIX gave birth to Linux 0.1 and it had promise.
Linux gave birth to v1.3 and it was good.
v1.3 gave birth to v2.0 and it was better.
Linux has evolved greatly from its distant cousins of the old. Linux is embodied by the Tao.
The wise user is told about the Tao and contributes to it. The average user is told about the Tao and compiles it. The foolish user is told about the Tao and laughs and asks who needs it.
If it were not for laughter, there would be no Tao.
Wisdom leads to good code, but experience leads to good use of that code.
The master Cox once dreamed that he was a Kernel. When he awoke he exclaimed: "I don't know whether I am Cox dreaming that I am a Kernel, or a Kernel dreaming that I am Cox!"
The master Linus then said: "The Tao envelopes you. You shall create great code for Linux."
"On the contrary," said Cox, "The Tao has already created the code, I will only have to find it and write it down."
A master was explaining the nature of the Tao to one of his students:
"Is the Tao in the VM subsystem?" he asked. "Yes," replied the master.
"Is the Tao in the scheduler?" he queried again. "The Tao is in the scheduler."
"Is the Tao even in the modules?". "It is even in the modules," said the master.
"Is the Tao in the Low-Latency Patch?"
The master frowned and was silent for much time.
"You fail to understand the Tao. Go away."
The Tao is the yin and the yang. It is the good and the evil, it is everything and yet it is nothing, it is the beginning and the end.
The Tao was there at the kernel compile, and it will be there when the kernel panics.
A novice user once asked a master: "Why compile in C when C++ is more popular?"
"Why a monolythic kernel when Mach is more popular?"
"And why use ReiserFS when ext2 is more popular?"
The master sighed and replied: "Why run Unix when NT is more popular?"
The user was enlightened.
A frustrated user once asked a master: "My kernel has panicked, should I post to lkml?"
"No," replied the master, "You will only bother the Tao."
"Should I rm -rf?"
"No, you will have wasted the Tao's time."
"Well should I search the web?"
"You will search for all eternity," said the master.
"Perhaps I should try FreeBSD?"
"Then you will have disgraced the Tao."
"I suppose I could try gdb," said the user.
The master smiled and replied: "Then you will have made the Tao stronger."
A stubborn user once told a master: "I run version 2.2. I always have, and I always will."
The master replied: "You are foolish and do not understand the Tao. The Tao is dynamic and ever changing. Linux strives for the perfection that is the Tao. It flows from version to version with peace."
"So my Linux does not have the Tao, so what?" said the foolish user. "Oh your Linux is of the Tao," said the master. "However, the Tao of Linux follows the Tao of the C library. One day the C library will change, and your Linux will be left behind." The user was silent.
An angry user once yelled at a master:
"My Linux has panicked! What lousy software it is, I hate it so!"
"You are insulting the Tao," said the master. "The Tao is everywhere bringing order to hundreds of networks, aiding thousands of users, and fighting that of which we call the 'lame.' Do not disrespect the Tao; however, the Tao will forgive you."
"I apologize," said the user, "And I will be more forgiving the next time the Tao fails me."
"The Tao has not failed you, it is you that has failed the Tao," said the master. "The Tao is perfect."
The Tao decides if a kernel shall compile, or if it shall abort.
The Tao decides if a kernel shall boot, or if it shall freeze.
The Tao decides if a kernel shall run, or if it shall panic.
But, the Tao does not decide if a box will have no hardware failures. That is a mystery to everyone.
A young master once approached an old master: "I have a LUG for Linux help. But, I fail to answer my students' problems; they are above me."
The master replied: "Have you taught them of the Tao?" he asked. "How it brings together man and software, yet how it distances them apart; how if flows throughout Linux and transcends its essence?"
"No," exclaimed the apprentice, "These people cannot even get the source untarred."
"Oh, said the master, "In that case, tell them to RTFM."
A master watched as an ambitious user reconstructed his Linux.
"I shall make every bit encrypted," the user said. "I shall use 2048 bit keys, three different algorithms, and make multiple passes."
The master replied: "I think it is unwise."
"Why?" asked the user. "Will my encryption harm the mighty Tao, which gives Linux life and creates the balance between kernel and processes? The mighty Tao, which is the thread that binds the modules and links them with the core? The mighty Tao, which safely guides the TCP/IP packets to and from the network card?"
"No," said the master, "It will hog too much cpu."
The core is like the part of the mind that is static. It is programmed at a child's creation and cannot be changed unless a new child is made; unless a new kernel is compiled.
The modules are like the part of the mind that is dynamic. It is reprogrammed every time one learns new knowledge; every time one learns better code.
One is yin, the other yang. Each is nothing without the other.
A novice came to lkml and inquired to all the masters there: "I wish to become a master. Must I memorize the Linux header files?"
"No," replied a master.
"Must I submit code to Bitkeeper?"
"No," replied the master.
"Must I meditate daily and dedicate my life to Linux?"
"No," replied the master again.
"Must I go on a quest to ponder the meaning of the Tao?"
"No. A master is nothing more than a student who knows something of which he can teach to other students."
The novice understood.
And thus said the master:
"It is the way of the Tao."
A user came to a master who had great status in lkml. The user asked the master: "Which is easier: implementing new features to the kernel or documenting them?"
"Implementing new features," replied the master.
The confused user then exclaimed:
"Surely it is easier to write a few sentences in the man page than it is to write pages of code without error?"
"Not so," said the master. "When coding, the Tao of Linux opens my eyes wide and allows me to see beyond the code, to let the source flow from my fingers, to implement without flaw. When documenting, however, all I have to work with is a C in high school English."
He who compiles from the stable tree is stubborn
and unwilling to change, but is guaranteed reliability.
He who compiles from the current tree is wise but perhaps too conformist, but is guaranteed steadiness.
He who compiles from the unstable tree is adventurous and is guaranteed new innovations: some good, some bad.
He who compiles straight from Bitkeeper is brave but guaranteed turbulence.
They are all of the Tao. One shall respect the old, and debug the new; none shall argue over which is greatest.
There once was a user who scripted in Perl: "Look at what I have to work with here," he said to a master of core, "My code is interpreted dynamically, the syntax is unique and simple, I have sockets, strings, arrays, and everything I could ever need. Why don't you stop meddling in C and come join me?"
The C programmer described his reasoning to the scripter: "Script is to C as ebonics is to Latin. If the scripter does not grow beyond that of which he scripts, he will surely [die]. Besides, without C, how can there be script?"
The scripter was enlightened, and the two became close friends.
Diary (and calendar) of a die-hard programmer (Score:4, Interesting)
Google Cache (Score:5, Informative)
Easier to read too.
The netcat code (Score:2)
"Linux, which is trying so hard to be posixly correct, I think I'm gonna hurl"
-sirket
Re:The netcat code (Score:5, Interesting)
-sirket
Linus (Score:3, Funny)
"//I wonder why this works"?
Re:Linus (Score:3, Informative)
I couldn't find exactly that comment. This is as close as I can get:
grep -ir 'wonder.*work' linux
linux/net/ipv4/arp.c: I wonder why people believe that they work.
linux/drivers/acorn/block/fd1772.c: * code - I wonder if it will still work... No
linux/drivers/nubus/nubus.c: * I wonder how the CRC is meant to work -
Re:Linus (Score:2, Insightful)
Bolixed. (Score:5, Funny)
It's about the most accurate error message I've seen yet - within half an hour it just wouldn't spin
a grrl & her server [danamania.com]
Sometimes, and it can cause problems too. (Score:5, Interesting)
Re:Sometimes, and it can cause problems too. (Score:4, Insightful)
N.B., I am not defending comments that are abusive to coworkers, slanderous, etc. That type of language has no place in an office.
But the tone of a comment is a valuable indication of how much effort was put into fixing it. If I see a comment like
it tells me that they RTFM but found a workaround. Maybe a future version of the library (or the FM) will get it right. I probably don't need to talk to the author before touching the code myself. In contrast, a comment like
tells me that they put a lot of effort into finding a solution to the problem, but every attempt failed. If I have an idea, I should talk to the author to see if he's already tried it. (Better yet would be a pointer to some internal document detailing everything they tried.)
This isn't absolute - many people will never let their comments contain any emotional tone, and others will swear at the slightest problem. But it's a valuable tool when it's used properly.
(Speaking of bugs, why does slashcode insist on merging paragraphs?)
Re:Sometimes, and it can cause problems too. (Score:3, Interesting)
Somewhere in one of the Paradox 3.5 for DOS executables, someone left a brief rant on upper management (it's readable text in the executable). Betcha that was some interesting source...
Re:Sometimes, and it can cause problems too. (Score:3, Informative)
History of the tie [croata.hr]
Well no, it's not all like that (Score:5, Funny)
I think that's the real reason MS won't release code. It isn't that the code sucks and they'd be emabrassed ( because that cat is already out of the bag), it's that it would reveal what a dull lot the lot of them were and make it hard to recruit.
I bet you won't find *one* "Fuck Clippy" comment in the whole code base, and you know they *want* to say it.
Damned marketroids won't let people have *any* fun.
KFG
Re:Well no, it's not all like that (Score:3, Insightful)
The developers in Microsoft can be quite at odds at the organization itself, like in any company...
Re:Well no, it's not all like that (Score:3, Interesting)
Naming an empty macro "Magic 8-ball" in Word '95 and putting it in the toolbar would give you a magic 8-ball shaped icon that would randomly spew the "Don't bet on it" or "Reply hazy-try later" kind of answers when you clicked on it.
Easter eggs weren't the exclusive province of the Office development team, either. The first 3D text screen saver under NT 3.51 had a couple of Easter eggs. Typing BEER into the text would bounce around names of beers. Typing VOLCANO would bounce around names of volcanos.
But once the temple thing was made public in the wild, Microsoft got all suity and made a big stink about it, and they claimed they'd fire anyone responsible for putting any new Easter eggs into any Microsoft product.
Hardware On Drugs! (Score:5, Funny)
cd
grep -r drugs *
linux-2.4.19/drivers/net/wan/dscc4.c:
printk(KERN_INFO) "%s: hardware on drugs!\n", dev->name);
FreeBSD's /usr/src/sys/pci/if_rl.c (Score:5, Funny)
Bill Paul, the guy who coded the Realtek 8139 driver put a very funny comment:
* The RealTek 8139 PCI NIC redefines the meaning of 'low end.' This is
* probably the worst PCI ethernet controller ever made, with the possible
* exception of the FEAST chip made by SMC. The 8139 supports bus-master
* DMA, but it has a terrible interface that nullifies any performance
* gains that bus-master DMA usually offers.
*
redefines the meaning of 'low end.' (Score:4, Interesting)
They probably don't pay as much per unit as a decent chocolate bar.
It brings up an interesting use for having source though, even if you don't code. Before buying a particular bit of hardware it might be interesting to read the driver comments to see what the programer thought of the thing at the low level.
KFG
Re:redefines the meaning of 'low end.' (Score:3, Funny)
Re:FreeBSD's /usr/src/sys/pci/if_rl.c (Score:3, Informative)
at my last job (Score:3, Interesting)
Funny comments from other systems (Score:5, Interesting)
panic("Shannon and Bill say this can't happen");
One of the first mass market Unix boxes was sold through the now-defunct line of Tandy computer stores and contained a 68000 and a Z-80 as an I/O processor. They apparently had problems with the Z-80 going insane periodically. This would be noticed by the 68000 which would then...
panic("Beam us up Scotty, she's sucking mud again");
Of course the most famous of all is the comment in the task switching code of the original v6 Unix (Lyons commentary era) which said
Re:Funny comments from other systems (Score:3, Insightful)
Of course the most famous of all is the comment in the task switching code of the original v6 Unix (Lyons commentary era) which said ... /* You are not expected to understand this */
And, of course, it means something like "this won't be on the exam". See Odd Comments and Strange Doings in Unix [bell-labs.com] for more of this kind of fun.
Re:Funny comments from other systems (Score:4, Informative)
Basicly what was going on was that fork() internally was a routine [newproc()] that returned 1 or 0 depending on whether you were the parent or the child .... and one of two things happened ... either you had enough memory, allocated it, copied the parent, and fudged up a return stack in the child to get back to return 0 (or 1 I forget which). But if you didn't have enough ram you'd swap out the parent and dummy up the swapped out image as the child, and set this bit in the process state saying you needed to return from newproc() somewhere in the swapper - which is why this comment was there - suddenly in the middle of a routine that returns no value it would test a flag, fudge the stack and return '1'.
Variable Names too.... (Score:5, Funny)
I remember my high school computer teacher made us make a pixel drawing program. Part of the specs was to be able to toggle between draw and move mode.
The natural variable names were...
PenIsUp and PenIsDown
Re:Variable Names too.... (Score:4, Informative)
On Error GoTo Hell
Or in general
GoTo ConsideredHarmful
GNU has a whole page with (more or less) funny variable names [gnu.org]
Re:Variable Names too.... (Score:3, Funny)
something to do with revenue in the "pipeline" (future/expected)
MyPipeFirm
MyPipeNotFirm
Re:Variable Names too.... (Score:3, Funny)
My favorite C variable name (Score:3, Funny)
{
}
I don't comment my code, I moderate it (Score:5, Funny)
Another gets a -1, Redundant.
I moderate API calls too. For instance, Win32's WaitForMultipleObjects gets a -64, Retarded. MacOS's HiWord trapcall gets a 0xFFFF0000, Utterly Pointless.
Unlike
Re:I don't comment my code, I moderate it (Score:5, Funny)
My favorite is WaitForMultipleObjectSex. Though my coworkers insist on capitalizing it differently for some reason....
Re:I don't comment my code, I moderate it (Score:4, Insightful)
But no it's not my first choice either for every application. A lot of what I want to do though fits very nicely in Java for instance, and Linux getting good thread support lets me go nuts without having to go with Solaris or NT.
If I were going to do something like using poll() I think I'd just implement the server in the kernel anyways. If I'm going to code in a platform-specific manner I'd just as soon put it all in the kernel and get the best possible performance while I'm at it.
It really depends on what you want to do. Using threads can make code a lot cleaner, and if you can allocate 100,000 of them in under 20 microseconds (which NPTL says it can do) then threads becomes a new tool that a lot more people will be reaching for.
Linx + NPTL + AMD 64-bit = everybody and their little sister coming out with massively scalable server implementations. It's going to be hard to
Ok, what's interesting is: (Score:3, Interesting)
I was looking for something terribly complicated and looking awesome to the eye...
... to put on a T-shirt. Most all his replies consisted of expletives and weird crap found in the kernel. Expletives are just more interesting than elegant code, I guess.
The worst I ever saw (Score:5, Funny)
Amusing Bits (Score:5, Funny)
From Perl 5.8.0's
"Checking to see how your cpp does stuff like catenate tokens...
Oh! Smells like ANSI's been here.
We can catify or stringify, separately or together!"
"You have POSIX termios.h... good!"
Gimp 1.2.3 was no less immune:
checking for intelligent life... not found
Both were found during the
Funny printk in die_if_kernel for sparc64 (Score:5, Funny)
And colleague and I where working a client E450 when we saw some funny ASCII art in /var/log/messages. At first, we believed that the machine got owned and the cracker was making fun of us. A little grepping later we found it in arch/sparc64/kernel/traps.c die_if_kernel() (around line 1450 for 2.4.18). I'd like to post the snippet, but the lameness filter refuse to let me do so. Go see for yourself.
BTW, kerneltrap.org comment posting system seem borked ... it ate my post !
Re:Funny printk in die_if_kernel for sparc64 (Score:5, Funny)
\|/ ____ \|/
"@'/
\__U_/
thats hilarious!!!
Encourage this! (Score:5, Funny)
Compare this to the boss I had that told me I wasn't allowed to call a variable "temp" (for temperature), because other programmers on the team might misunderstand and think that's a temporary variable.
grep fuck (Score:2, Funny)
Someone in the group I used to be in at MIT's Lab for Computer Science used to grep out all the fucks and shits before she'd do a release of our TCP for V6 UNIX.
Cray-3 compiler declaration (Score:5, Funny)
some suprises from apps (Score:5, Funny)
and one from the slackware adduser script..
i also remember a good one in the enlightenment configure script though i dont have it saved .. something about searching the -lfridge for lager ;)
Not all, but a lot (Score:2, Interesting)
I like to think that having interesting comments (non abusive comments mind you) in the code shows the developers are enjoying themselves and working on something they like and with a team they like. Our code is sprinkled with numerous quips and questions and many comments are part of a running joke involving one of our team members and his (humourous, not real) abusive drinking.
You do have to be careful though. In one previous version of our product some Javascript code (i.e. viewable in the browser) went out with a comment along these lines: "How could this have ever worked? No one must have tested this part at all." It was removed shortly after a customer called to complain about it.
shutdown.c (Score:3, Funny)
Dutch code! (Score:5, Funny)
#ifdef WIN32
static int is_a_really_crappy_nvidia_card(void) {
static int well_is_it= -1;
if (well_is_it==-1)
well_is_it= (strcmp((char*) glGetString(GL_VENDOR), "NVIDIA Corporation") == 0);
return well_is_it;
}
#endif
Re:Dutch code! (Score:3, Insightful)
after I was laid off ... (Score:5, Funny)
if ( $get_out_while_you_can == $or_they_will_fuck_you ) {
$with_a_cold_aluminum_baseball_bat = 1;
}
and
if ( $this_company_is_run_by_morons == $i_hate_them_all ) {
die();
}
Re:after I was laid off ... (Score:3, Insightful)
I'd rather have a hacker in my system than an angry coder any day. They should get a clue.
What a loser (Score:2, Funny)
Any other /. references in Linux kernel? (Score:5, Funny)
% sed -n 2,5p
* Heavily influenced by the old firewall.c by David Bonn and Alan Cox.
*
* Thanks to Rob `CmdrTaco' Malda for not influencing this code in any
* way.
Re:Any other /. references in Linux kernel? (Score:5, Funny)
* Heavily influenced by the old firewall.c by David Bonn and Alan Cox.
*
* Thanks to Rob `CmdrTaco' Malda for not influencing this code in any
* way.
Ahh, good to see that there is some code out there with no spelling errors
Especially in code that uses MFC (Score:2)
I'm sure we can all figure that much out since my company has a problem with explicatives in code comments.
Strangely enough ... (Score:4, Interesting)
Some true gems (Score:2, Informative)
Just just gotta love this one: /* Fuck. The f-word is here so you can grep for it :-) */
include/asm-mips/mmu_context.h:
Some of mine... (Score:2)
"If you see this, I've done fucked up"
"You did something really dumb."
Ex-girlfriend commentary as assembly line labels (Score:5, Funny)
Anyway, getting on with the story, after that event, he cranked out phenominal amounts of microcontroller code - all very intricate, clever, and good (from an engineer's point of view, not necessarily from a comp-sci view). However, written in assembly, he was forced to regularly come up with line labels for jumps in the code. These rapidly devolved from useful things like
Lousy maintainability, but it was microcontroller code that nobody would ever again touch. Or, based on what we know of the teams after us, even understand.
from code I used to work on (Score:5, Funny)
#endif
This text is here because the above code triggers the lame filter. You know, that thing they put in the slash code to force crapflooders to be creative.
How about a flow chart? (Score:5, Funny)
[...]
/*
* Check for clue free BIOS implementations who use
* the following QA technique
*
* [ Write BIOS Code ]<------
* | ^
* < Does it Compile >----N--
* |Y ^
* < Does it Boot Win98 >-N--
* |Y
* [Ship It]
*
from a professional shop (Score:5, Funny)
One member of the team has a reputation for doing useful but wacky things, and most of examples of his code were prefixed with
At some point a bug-fix had been applied by a junior programmer, prefixed by
Half-Life SDK comments (Score:5, Funny)
Sadly, not too much in FreeBSD. (Score:3, Funny)
Under
$ egrep -ir "( fuck)|( shit)" *
alpha/tc/esp.c: * Things are seriously fucked up.
dev/sym/sym_hipd.c: * brain-deaded stuff that makes shit.
i386/i386/math_emu.h: * structure to 12 bytes which breaks things in math_emulate.c. Shit. I
Doing it outside the
Grepping kernel src... (Score:3, Funny)
fs/reiserfs/inode.c: /* crap, we are writing to a hole */
drivers/usb/uhci.c: * is just crap, written by a committee.
net/ipv4/tcp_input.c: /* Old crap is replaced with new one.
drivers/sbus/audio/cs4231.c: * how this crap gets set.
drivers/net/3c501.c: Do not purchase this card, even as a joke. It's performance is horrible
net/ipv4/ip_sockglue.c: I have no idea, how it will masquearde or NAT them (it is joke, joke :-))
net/ipv4/tcp_input.c: * Funny. This algorithm seems to be very broken.
Burning Printers (Score:3, Informative)
And apparently, originally it was a very legitimate error message.
Another bit of lore and trivia for the mad scientist to know
;-)
ASCII Art comments (Score:3, Interesting)
If you ever need ASCII art comments, head here:
ASCII Generator [network-science.de]. It can use many different "fonts". Great utility.
Example I found (Score:3, Funny)
# SUB-PEN.
# Of post-Soviet-Russian variety, with Chechens and a whole bunch of
# paintable action figures so you can recreate your very own news
# broadcast! Parents, dare you deny your children this fabulous
# opportunity of becoming journalists? Too much caffine has been had.
Mainframe humor: BDOLVB (Score:4, Interesting)
1770 = BirthDate Of Lidwig Van Beethoven
Since they spun their wheels for a few days tracking this down, they weren't smiling all that much at the cleverness of this.
The thing to remember is that code is harder to read than to write. The author has context, information that the reader doesn't have and has to guess at. If you want to be funny, do so, but don't interfere with the ultimate goal of source, to make it easy for people to see and change your code.
Re:Cool (Score:5, Funny)
If so then, yes, programmers do have humor. (Atleast this one does...)
Proper code indentation (Score:5, Funny)
I ran across this gem awhile ago, been saving it as a text clipping on my desktop for years now waiting for the perfect moment to post:
- Shane Smith <Shane.F.Smith@Healthnet.com> on proper code indentation, in comp.os.vms
Mozilla and clearing history (Score:3, Informative)
The comment above the code for clearing the history in mozilla is something like
Mozilla has lots of stuff like that.
I mean this is how you import the standard library ->
xmlns="http://www.mozilla.org/keymaster/gatekee
Hardly (Score:5, Funny)
I've been known to "talk to myself" in my comments, but I do keep it PG-rated or cleaner. Sometimes at a function exit point you'll see "all done, have a nice day".
Re:Hardly (Score:2)
That is frighteningly similar to something I wrote in some code a couple years back. It was never anything that would have left the office. At least I hope not. It was one of those "Here ya go, you have till 5pm" projects. I've also posted about management conditions, such as "When you have to produce over 5K lines a week, you do stuff like this:"
Re:Is all code like this? (Score:2, Interesting)
what about the hidden games in MS Office and developers fun page in one of windows OSes?
talking bout "highly professional" developers here!!!!!!
Re:Is all code like this? (Score:3, Funny)
"What kind of an idiot needs help with this?"
Not an exact quote, but you get the idea. He was fired, and the company sent letters to their customers explaining that they didn't think they were idiots afterall.
Re:Is all code like this? (Score:2)
the coder that was fired for putting a comment on the "help" button
How about the coder that was fired because he left a test name in a database? This guy was working on a mail merge program for some financial house and used "Rich Bastard" as the default name for accounts. Unfortunately, he forgot to remove it and a bunch of letters went out to investors ("Dear Rich Bastard, We value your business blah blah blah").
Re:Is all code like this? (Score:2)
Re:Is all code like this? (Score:2)
(J/K, Mozilla rules!)
Re:Is all code like this? (Score:5, Informative)
Now when the customers SEE these msgs, you really get to see what kind of company you work for... at a former gig we had a debug mechanism which caused a debug msg to be displayed when the program crashed in in debug mode. Theory was, the customer would never see these msgs but they were helpful for debugging. Some customer happened to run "strings" on the executable and since they're compiled (unlike comments), got to see a whole lot of messages along the lines of "we should never get here" etc. Kind of funny, really. The customer thereafter put out an anual list of interesting strings found in the program and everyone got a chuckle out of it. None of my comments ever made the list tho
Re:Is all code like this? (Score:3, Funny)
Other great comments I've seen:
"Now we can go to the nth dimension and see superman!"
"I think this works. I'd know for sure, but it's 3:47 AM and I want to go home."
"F this code."
checkin comment - "I suck."
checkin comment - "Removed unholy blight that is X."
Then there's the scary comments. They're typically about 12 lines long, include directions to talk to somebody, and precede a line of code as deceptively simple as "x += 2;".
Re:Is all code like this? (Score:3, Insightful)
No comments at all are (rightly) far more likely to get you fired.
Re:Is all code like this? (Score:3, Informative)
Have a lot more trouble without comment.
Now picture the following:
- some developers are writing a scanner driver for a medical scanner
- at some exotic combination of resolution, size and so on, the driver gives an embedded image instead of the real one
- during development this is a bikini calendar
- someone forgets to replace this image and put in the team foto
- a hospital in Iran decides to use a front end to automatically calculate the scanning parameters and guess what ? It hits those specicific values and
Talk about an incident. This even stirred political comment.
Do you think people got fired ???
In PC world (like the USA) probably for sure.
And today it might be a reason in Europe too.
But 10 years ago the repercussions in the European firm concerned did not go that far.
So get a life, there's more than just code in code.
Re:Is all code like this? (I hope so!) (Score:3, Interesting)
Re:Anyone remember (Score:4, Funny)
someone talking about "Kernel Klink" embedded somewhere?
Of course not - we know NOTH-ING!
Re:The purpose of comments is to be USEFUL... (Score:3, Insightful)
Unless the spurious commenting actively obstructs maintenance -- and it's hard to imagine how it could do that -- it's perfectly fine if it's funny, witty, or (gasp!) off-task. Work is done better by those who enjoy themselves doing it.
Re:The purpose of comments is to be USEFUL... (Score:3, Interesting)
This is a common misconception. Unhappy, overly criticized workers are less likely to make mistakes, and get more accomplished. In the general case. Extensive research on the subject has been published, although I'm not interested in hunting it down.
Mental note (Score:5, Funny)
Re:Horse & Pig reference in Kernel 2.4.20 (Score:3, Informative)
Lots of answers, but most of them not really good. How about reading the man page. After doing that, I came up with this:
grep -ir "\<ant\>" *
The use of -i is simpler than specifying every letter could be upper or lower case. And the use of spaces at each end of the word misses those cases where where other chars are used at the word boundaries. Then better use the grep builtin feature to indicate start and end of a word.
Re:You are not expected to understand this (Score:3, Funny)