Linux Kernel Code Humor
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?"
Yes.
Haven't been working long in the real world, eh?
... hi bingo
someone talking about "Kernel Klink" embedded somewhere?
Nice to see the coders have a sense of humor :)
The best code comment I heard about (in a discussion about code commenting, I believe) was something like this: /*** DRUNK -- FIX LATER! ***/
pb Reply or e-mail; don't vaguely moderate.
Something forms itself from the silent void of the empty mailing lists and the noisy chaos of the crowded mailing lists. It shapes and protects us, it entertains and challenges us, it aids us in our journey through the ether world of software. It is mysterious; it is at once source code and yet object code. I do not know the name, thus I will call it the Tao of Linux.
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.
I hardly see how they performed a recursive search on the code. It looks like the good ol' faithful sequential search.
In the days when I was a die-harder coder (unlike the current easy life as a part time manager and part time developer) I used to keep my diary and calendar in code comments - those were, of course, the days without funky handhelds with funkier PIM systems :-) *sigh* The good old days....
-- Gaxx
Linked off of article here.
Easier to read too.
In the netcat source code, Hobbit had a comment in the Linux define section that was pretty funny. It went something like:
"Linux, which is trying so hard to be posixly correct, I think I'm gonna hurl"
-sirket
one of the funniest comment I reed in the code was for RealTeck(?) networkcard (10Mbit) .. the comment said that the chipset was "Fucked by design" =)
Is it true that there somewhere in the kernelcode is a comment by Linus saying:
"//I wonder why this works"?
"GNU's not Unix....it's Linux" / Kami "kokamomi" Petersen
Around the middle of July last year the drive in my web server (a 10 year old 250mb SCSI) died. The first I knew about it was an error along the lines of "device is bolixed".
:)
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
...Fiiive core dumps! ...Four reformats ...Three gigs of porn ...Two linux games ...And a usless app on a burnt CD.
Repeal the DMCA!
A couple years ago the company I'm working for had sold the source to one of their business commerce systems to another company. The comments were sprinkled with some superlatives such as 'fuck' and 'son of a bitch' not to mention that there were a few other not-so-nice comments about other products like 'since this fucking windows bug' or what not heh. This other company was NOT very happy at all. It resulted in one person being let go when there were some small "budget" problems even though they just sold some software for over a million and this company wasn't very large (under 20). After he was let go they hired 3 new people. Lukly I just started about a week before this happened so I never got in trouble. Anyway, now the management scans the comments periodically to look for colorful words.
I've seen code from one of our vendors with comments such as "whoever wrote this should be shot. but it was probably me. no time to fix it." He both admitted it was sketchy code and said it like that - and then we bought it.
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".
Only the best code written by the coolest people in a great working enviroment is like that.
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
Just grep the kernel sources for bad words, you'll be suprised (and amused ;) ).
My personal favorite is the "Hardware On Drugs" message.
/usr/src/linux
cd
grep -r drugs *
linux-2.4.19/drivers/net/wan/dscc4.c:
printk(KERN_INFO) "%s: hardware on drugs!\n", dev->name);
Karma: Not Particularly 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.
*
i was reprimanded for extensive offensive language in my code. how else to keep it interesting?
In the VM subsystem for the Sun-3 kernel, about late 1986 I think, there appeared the following:
... /* You are not expected to understand this */
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
One can be very colorful with variable names too.
...
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
Tournament Management Online &
there's is_computer_on_fire() funct that actually checks the processor temperature and a is_computer_turned_on() which you were supposed to call before anything else...crazy stuff
:D
at napster (back when it was alive) in the mac version of the src tree there were insane amounts of comments about dustin's mom
I think a sense of humor represents the imaginative side of the programmer. I find that programmers with a sense of humor often produce more creative solutions and aren't as afraid of the code or the solutions compared to their more staunch, anal-retentive counterparts. The coder with a sense of humor seems to live for creative endeavour of the coding, and in my opinion often produces a better solution sometimes even faster because they are enjoying the process. And if the humor gets reflected in the code then so be it -- we call all share in the laughs.
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.
Sex - Find It
Invoicing, Time Tracking, Reporting
I was compiling Perl 5.8 when I found these funny little tidbits:
./Configure:
./configure stages of compiling the source.
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
"There is a way that seems right to a man, but its end is the way of death." Proverbs 16:25 (NKJV)
the first guy's comment was:
-calyxa
Decay! Decay! Decay! -Helium
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 !
:wq
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.
www.HearMySoulSpeak.com
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
All editorial writers ever do is come down from the hill after the battle is over and shoot the wounded.
Yes, I think most all code has a lot of cursing in it.
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.
While working for a loony British midget at Cray Computer Corporation, I put the declaration "short volatile *VP;" into the compiler's optimization phase.
"Skill shows through where genius wears thin." -Wittgenstein || Religion: uniting aviation and architecture.
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 ;)
My fav source is the malloc source for FreeBSD, it isn't so much funny as upbeat. I feel inspired when I read it.. All code should be commented like it...
/* As in "Duh" :-) */ /* Are we trying to die? */ /* If we are already sinking, do not making things worse */
/etc directory, and put nothing but the letter H in it. Effectivly it will never make a difference due to the fact unused pages eventually get swaped out.. but it helps keep the resident size of your programs down...
#define SOME_JUNK 0xd0
static int suicide;
if (suicide) return;
But then ther is some code I have read by people that is just boring and sad... you can see their flustration in their comments, and their code usually causes problem.
Where the malloc and general VM implementation of FreeBSD tied together is what has made it the powerhouse it has always been in a paged environment. You can read college style papers on the theory behind it, and people had fun implementing it. Funny how that works.
Furthermore, as a small hint... on freebsd, it was always good to make a file called malloc.conf in the
At my company, yes, there are interesting comments all through the code. They aren't as colorful as the Linux kernel though (those kind of comments would probably get you in trouble in a business setting).
:)
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.
While neither in Linux nor in the the kernel, there is some humor in shutdown.c (/usr/src/sbin/shutdown) in both FreeBSD and OpenBSD. The function die_you_gravy_sucking_pig_dog gave me a good laugh when I saw it the first time.
Here's my favourite part of the Blender source:
/* Do you understand the implication? Do you? */
#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
nt
Cover your eyes and click this link!
I said you couldn't *find* it.
Two totally different statements.
As you note the code gets cleaned up before release. Management learned a long time ago that it's wise to grep for "fuck" before letting raw code out the door.
KFG
from my old job at a dot com I was instructed to make the website "self-maintaining". I was laid off on a friday but was told I had to spend the next week doing this. I remember one of the last scripts I worked on had something like this:
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();
}
Also the ammount of 'shit' and 'fuck' words totally blew me off :)
either this guy meant to write "totally blew me AWAY" or he really needs a girlfriend
I wonder why nobody has mentioned this:
./net/core/netfilter.c
% 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.
MFC is the worst toolkit I've ever used and it has so many wierd quirks and odd behavior that I've got tired of commenting each of them. So I now just comment everything as: // FMFC
I'm sure we can all figure that much out since my company has a problem with explicatives in code comments.
Things you think are in the Constitution, but are not.
Here's one not many will remember (or want to):
An ancient big iron OS that ran on Xerox Sigma's, Honeywell (now Bull) DPS/DPX mainframes and others was called CP-6 (Control Program 6) and chock full of funny messages. Among them...
"Recovery says.... Hang loose..." (during a screech/system crash)
"Th Th Th Thats all folks" (Final message during System Shutdown)
"Oink:" (Prompt for PIGGETTE (format) command)
and many others.
In addition, during a screech (system crash) the message was sometimes accompanied by a reference like "This is the 'insert name(s) here' memorial screech". The person(s) named were departed programmers from the Los Angeles Development Group (LADC) who wrote and maintained much of the CP series.
I guess this is why Road Runner stuck me with one of these things.
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
egrep -ir "windows should be destroyed" *
:D
well almost...
"if i'd known it was harmless, i'd have killed it myself"
... (or maybe not) i usually find more funny comments in code from people who actually like coding (and are good at it) than from code monkeys .
Just just gotta love this one: /* Fuck. The f-word is here so you can grep for it :-) */
include/asm-mips/mmu_context.h:
Not so much on the comments, but I have error messages like this:
"If you see this, I've done fucked up"
"You did something really dumb."
well said, i hope it's true.
"if i'd known it was harmless, i'd have killed it myself"
Any language that allows:
:)
$link = mysql_connect($dbase,$uname,$pass) or die("horribly");
is a language of choice for programmers with a sense of humour
I am the Barber of Seville.
I was an assembler programmer for a fair while. It was usual to name counters as CNT01, CNT02 etc. These were read out during code reviews as CNT OH ONE. A manager forbade the use of this abbreviation as it was considered crude. Thus we renamed all of the jump entries in the jump tables (remember those?) to the names of favourite girls. These became JMP JANE, JMP NICOLA etc. and were read out as such.
I'm surprised I haven't seen this posted... When exiting the scheme the very last thing it prints out is "Happy Happy Joy Joy". With *hit ops like cons car and cdr, who would have thought they had a sense of humor ;)
Several years ago, there were three of us, all working (well, "working") for our university's solar car team. Most of the telemetry code was written by one of the other guys (whose basement I'm now writing this from), and somewhere mid-project his girlfriend royally screwed him over. As we now tell people, it wasn't that she was a raving bitch, it was just that she really, really liked guys. All of them, everywhere, personally and intimately. :)
:CRC16UpperCalc before the girlfriend disaster to things like :LivsABitchDieDieDie afterwards. Made for some very funny looks back at the old code, but rather frustrating for anybody to debug. After all, how was I supposed to know the difference between the functionality of one with three "die"s and one with four "die"s. And yes, there was a difference, and yes, he knew exactly what each did.
:)
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.
#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.
The cake is a pie
arch/i386/kernel/dmi_scan.c
[...]
/*
* 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]
*
GNU hello, which is a joke to begin with, has some funny code and constructs. As I remember, various little functions are tucked away so you don't see them until you suddenly come to "while (elvis the king lives)", and it compiles fine. SunOS had at least one funny Dr. Suess joke in the public /usr/include headers, but I don't have a copy of SunOS any more so I don't remember it exactly ;)
Advice: on VPS providers
doors.cpp //This is the most hacked, evil, bastardized piece of code ever written.
linux/arch/mips/kernel/sysirix.c:
:
/* Time to push up daises... */
/* ... else the timer will get him soon. */
:-( All the routers (except for Linux) return only
/* 2,191 lines of complete and utter shit coming up... */
linux/net/ipv4/netfilter/ip_conntrack_core.c
while ((h = get_next_corpse(kill, data)) != NULL) {
if (del_timer(&h->ctrack->timeout))
death_by_timeout((unsigned long)h->ctrack);
ip_conntrack_put(h->ctrack);
linux/drivers/net/ eepro.c:
printk(KERN_INFO "eepro_init_module: Auto-detecting boards (May God protect us...)\n");
linux/net/ipv4/ip_gre.c:
#ifndef I_WISH_WORLD_WERE_PERFECT
/* It is not
8 bytes of packet payload. It means, that precise relaying of
ICMP in the real Internet is absolutely infeasible.
Moreover, Cisco "wise men" put GRE key to the third word
in GRE header. It makes impossible maintaining even soft state for keyed
GRE tunnels with enabled checksum. Tell them "thank you".
Well, I wonder, rfc1812 was written by Cisco employee,
what the hell these idiots break standrads established
by themself???
Don't forget to grep the source for "borken" - did they typo alone or were aliens involved?
--
est modus in rebus
...not to show off... not to be entertaining... not to conform to an internal coding standards document... not to give an impression of "professionalism"... not to vent or blow off steam...
The purpose of comments is to be helpful and useful to whoever needs to work on the code next. 90% of the time, of course, that will be the person that wrote the code originally.
"How to Do Nothing," kids activities, back in print!
I work in a professional software house, and a while back I write a utility to trawl through some source code for an application and extract the comments. The ratio of 'practical' comments to frustration-venting, sideswiping and humour ran at about 50:50.
/* Trust me...I know what I'm doing */
/* don't trust me...I may not know what he was doing */
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
Given that half of the NIC chips I've ever seen are RealTek 8139's, it's even funnier.
If you were blocking sigs, you wouldn't have to read this.
First of all, 90% of "#$^%$ windows bug" code comments I have read were not windows bugs at all. Secondly, 99% of code comments trying to be funny are not funny at all in the cold light of day. So my advice is to save your commedic stylings for open mic at the Laugh Shack.
One more thing. Everytime I see someone wearing one of those code jock T-Shirts with source code, I fanatasize about headbutting the individual down a steep flight of concrete stairs. Memo to those folks- the really bright programmers I have met wear Banana Republic, don't have facial hair and stay in shape.
// f*ck you palm :P - get around that darn limitation
:)
you dont want to know how many times i have that comment in our code. its amazing how pissed you get when you find out the environment your programming for has limitations you would never expect
See here and my sig.
Yes, speaking of "Fun" errors to see in your morning logs...
messages:Jan 4 13:20:01 TheSunGod kernel: VFS: Busy inodes after unmount. Self-destruct in 5 seconds. Have a nice day...
I loooved seeing that coming from our beefy db server, when it looks to be a harmless error stemming from it's NFS exports.
Fun Stuff!
Nick Lange nick.lange@SPAMTASTIC.hushmail.com
Humored Kernels not comment code from YOU!!!
...the entire OS is the joke.
I think this was pulled a couple months back; it confused newbies, and was really applicable back in the old days of tractor feed dot-matrix printers where a jam really would cause a fire (or at least make your printer smoke) but not in Laser Printer days. Someone missed it so much he made a patch against the kernel to restore it.
This is a holdout from older Unix. It is an error message that is supposed to stimulate lazy users to get off their ass and LOOK at the printer, instead of just calling the admin and saying "my job won't print".
It frequently stemmed from a paper jam, no toner or other trivial fix that simply required someone to physically go to the printer.
Learning HOW to think is more important than learning WHAT to think.
At least they are doing the exception handling.
All I found on code form my monkeys here is:
"On Error Resume Next" (or something like that, I am clueless about VB)
disgusting if you ask me.
cheers.
``If a program can't rewrite its own code, what good is it?'' - Mel
In a fix to LiveJournal's HTML sanitizer, we can see that one of the developers perhaps wasn't happy with the standard of commenting used when another developer was forced to fill a regex with lots of \s* to make sure the sanitizer didn't let through anything which might cause IE's over-zealous parser to execute some JavaScript.
"god IE is a fucking piece of shit" might not be the most innocent comment in the world, but at least it puts the blame in the right place...
Check out the rest of the code for other sprinklings of code necessary due to the amazing flexibility IE offers. Oh yes.
- Take intelligent, creative people
- Stick them in boring, repetitive jobs
- Stir
While this comment is humorous, it's also very deep. It shows that the coder understood what he was doing well enough to know that the behavior wasn't as expected... and anyone else touching the same code should expect problems.
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.)
For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
I must admit, the "happy meal ethernet" kernel code is amusing. drivers/net/sunhme.c check out the happy_meal_tcvr_write function :)
Not too much in FreeBSD running the same tests. (Yes, I have nothing better to do today, thank you). (Results white-space edited)
/usr/src/sys/
/usr/src/sys/ tree has many more results, but alot of them come out of the fortune files. No funny stories I could find, but I'm sure someone else can. =)
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
There have already been many things written about professionalism in programming, e.g., philg,
jwg.
As for me, I made stupid / humorous / profane remarks in real life. My code is about the same. If it's designed well, works well, and J. Random Hacker can understand it from reading the comments, why would anybody give a rat's ass what sort of shit I put in there? (My boss sure doesn't. My users sure don't.)
[...linux-2.4.20]$ grep -r horse *
:)
arch/arm/mm/proc-arm2,3.S: * MEMC workhorse code. It's both a horse which things it's a pig.
Does anyone know how to do grep for "ant" (exact word by itself)?
Ant(Dude) @ Quality Foraged Links (AQFL.net) & The Ant Farm (antfarm.ma.cx / antfarm.home.dhs.org).
I keep finding this in different forms: public static String meaningOfLife = 42;
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.
At a previous company, management had one of our full time engineers spend several days going through our code looking for those Seven Dirty Words You Can't Say On Television. Did he remove them? Not exactly... every single one of them became the word 'puff'.
This led to some interesting comments.
I am the very model of a modern major general!
I was writting a program and i had a variable that the user was supposed to input int's in and when the user entered something else it would go "Error: User is a dumbass"
teacher got came to see me and told me if she saw that again shed remove points
At a previous life I was maintaining a text app built in OS/2 and hit the end-of-line key in Brief (my editor of choice back then) and noticed I was waaaayyyy past column 80. I started hunting around and found that a long-gone programmer had put in some text messages past column 80 that wouldn't be casually found.
They flashed by very quickly in our UI and said "Xxxx deserves a raise." "Xxxx does great work." "Xxxx should be a lead."
Of course, as those message boxes weren't causing the bug, I left them alone.
"First, do no harm."
ex cow-orker[1] (who posts here, hi Ian) - the entire lyrics of "I'm going slightly mad" by Queen
ex cow-orker[2] - something along the lines of "redundancies, they've laid of billy and morris, I can't be arsed to do this, sod 'em I'm off for a drink"
me (although I don't remember coding it, long day etc) "cover me - I'm going in" just before some debug printfs
rich
lol, there's even one that says "sucks out there" and "cloudy"
An article similar to this was posted sometime over a year ago I'm certain where we discovered all sorts of interesting tidbits of humor within the kernel (mostly of words with expletives). It'd be easy to find if I could look back through all the comments I've posted (thanks /.), but I can't turn anything up via either Slashdot's search engine or Google... Anybody know what article this is?
SIG: HUP
arch/i386/kernel/mtrr.c:1088:/* Some BIOS's are fucked and don't set all MTRRs the same! */
:971: <title>The Fucked Up Sparc</title>
/* task can fuck it up GTL */
/* This card is _fucking_ hot... */
/* Be careful, we could really get fucked during synchronous
/* Be careful, we could really get fucked during synchronous
/* Fuck me plenty... */
/* Ugly, ugly fucker. */
/* Ugly, ugly fucker. */
:-)
/* James M doesn't say fuck enough. */
/* This is fucking braindead. There is NO WAY of doing this without
/* Grrr... SACK. Fuck me even harder. Don't want to fix it on the
Documentation/DocBook/kernel-locking.tmpl:65 0: If you don't see why, please stay the fuck away from my code.
Documentation/DocBook/kernel-locking.tmpl
drivers/cdrom/sbpcd.c:4927: blkdev_dequeue_request(req);
drivers/char/drm/drmP.h:690:extern int DRM(release_fuck)(struct inode *inode, struct file *filp);
drivers/ide/cmd640.c:16: * These chips are basically fucked by design, and getting this driver
drivers/net/macsonic.c:166: fuck did SONIC_BUS_SCALE come from, and what was it supposed
drivers/net/sunhme.c:1014:/* Only Sun can take such nice parts and fuck up the programming interface
drivers/net/sunhme.c:2086:
drivers/scsi/NCR53C9x.c:1770: * how bad the target and/or ESP fucks things up.
drivers/scsi/NCR53C9x.c:2690:
drivers/scsi/esp.c:2575: * how bad the target and/or ESP fucks things up.
drivers/scsi/esp.c:2663: * phase things. We don't want to fuck directly with
drivers/scsi/esp.c:3357:
drivers/scsi/qlogicpti.h:76:/* Am I fucking pedantic or what? */
drivers/sound/aci.c:161:/* The four ACI command types are fucked up. [-:
fs/binfmt_aout.c:313:
fs/jffs/intrep.c:2983: don't fuck up. This is why we have
include/linux/netfilter_ipv4/ipt_limit.h:1 8:
include/linux/netfilter_ipv6/ip6t_limit.h:18 :
lib/vsprintf.c:9: * Wirzenius wrote this portably, Torvalds fucked it up
net/core/netfilter.c:440:
net/ipv4/netfilter/ip_conntrack_core.c:1138:
net/ipv4/netfilter/ip_nat_helper.c:249:
net/ipv4/netfilter/ip_nat_snmp_basic.c:1028 : * (And this is the fucking 'basic' method).
net/ipv4/netfilter/ipt_limit.c:8: * Alexey is a fucking genius?
net/ipv6/netfilter/ip6t_limit.c:8: * Alexey is a fucking genius?
Note to M1-ers: a curt but otherwise insightful message is not "Flamebait" or "Troll".
There's nothing worse than poorly written code, except poorly written code with humourous comments (or no comments) especially when you're in crunch time and have to put out a fix to a customers problem, and don't know why they're running into the situation that they are because the developer never thought enough about the design (things like serviceability) before they wrote the bloody code. Stuff like this really strikes a nerve:
/* should never get here!!! */
.
.
.
/* TODO: dude, put the security stuff here */
switch (id)
{
case OP1:
jim = 15;
break;
case OP2:
jim = 4;
break;
default:
fprintf(stderr, "Invalid id %d\n", id);
exit(-1);
}
return 0;
Humourous comments in well written code is acceptable, you likely never really need to completely analyze the comments in well written code. However, in code that is poorly written the last thing I want to see is some smart ass remark about how the answer to everything is 42 or that a particular flow should never get here, or some lame ass who forgot to code the rest of a switch / IF clause by leaving a comment stating
I do not fail; I succeed at finding out what does not work.
I got chewed out for adding the variable
EvilBackDoor=true
or something like that on a internal company website. everyone except my supervisor thought it was fricking hillarious. it didn't do anything, just another waste of space.
I quit shortly thereafter when I realized the boss had no sense of humor.
Looking for Book Reviews? Check out Literary Escapism.
while (e_coyote)
/* code goes here */
{
}
And apparently, originally it was a very legitimate error message.
Another bit of lore and trivia for the mad scientist to know
;-)
"It is a greater offense to steal men's labor, than their clothes"
now everyone in ece at queen's has questions on their final exams about the cruise control and telemetry system from the solar car and pseudo code for them is included in the text book. Now I know why they didn't give out the acutal 6811 assembly code.
Its fuckheads like you that make our lives miserable when we have to go back and FIX YOR FUCKING code because you didnt take into account stuff like buffer overflows and counter overflows....
If you ever need ASCII art comments, head here:
ASCII Generator. It can use many different "fonts". Great utility.
Random is the New Order.
Original Usenet post by Shane for those interested.
All editorial writers ever do is come down from the hill after the battle is over and shoot the wounded.
I worked for the Artist formerly known as Walker Interactive Systems. Current Doing business as Elevon. Scrolling through the Gateway code I had recently inherited from a departed collegue, I came across a long stream of difficult code. I guess the half I scrolleed through wasn't as bad as what came after, because right there in the middle was: /* Job Security */
THen it got really bad.
Open Source Identity Management: FreeIPA.org
drivers/scsi/scsi_lib.c: * Now, if we were good little boys and girls, Santa left us a request
Most companies strip comments from their code when they release it. At Data General we had the AT&T UNIX code with all the comments stripped. I'd have loved to have seen the comments on THAT!
My personal favorite comment is still /* DON'T CHANGE THIS LINE UNLESS YOU REALLY KNOW WHAT YOU'RE DOING. */ It's actually been proven to be futile, since a guy who didn't know what he was doing changed the line, breaking the code for an entire class of machines. It should just be shortened to /* DON'T CHANGE THIS LINE. EVER. */
I'm trying to teach myself to set people on fire with my mind... Is it hot in here?
In the old C For Dummies book is a little tidbit that was never actually made into a lesson in the book, but was thrown into the introduction:
while horse==dead
{
beat(horse);
}
The weird thing is, I actually caused a northern CA girl to nearly asphyxiate from laughter when I printed this over IRC to her.
This sig no verb.
As to comments, my best ones always happen while I'm working with Java's date and time stuff, which always seems to me to be pervsely broken.
v = "'" + new java.sql.Date( value.getTime().getTime()).toString() + "'";
. . .
catch ( ParseException p)
{
. . .
if ( offset == 0)
else. . .
* a complete balls-up of rendering itself as a string. I have
* commented elsewhere on the wanton overcomplication of the Java
* date handling code... I hope the person who designed it is for
* ever after forced to keep his diary using the output from
* GregorianCalendar.toString() as his date format.
I'm old enough to remember when discussions on Slashdot were well informed.
Not in the kernel, but ... (and this was in Perl code, so, make your own inferences):
# 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.
Score:-1, Funny
Just reminded me of what my colleague put together yesterday:
..... from ... ....
:-)
select
where status in ('S','A','N','E')
It took him quite some time to find out why I rolled on the floor
(S -soon finished, A - active, N - new, E - error, if you ask)
Thanks god (or whoever is in charge) that it's after midnight and I don't sit at work, given that I just came down with a red face from a hysterical laughing spree.
Although one must say that bolixed devices are not funny at all. I experienced bolix on one of my old hard disks. But then again I was able to restore most files, alas that fucker made rather strange noises upon choking out its remains.
Bolix! But otoh it tought me to do backups.
ich bin der musikant
mit taschenrechner in der hand
kraftwerk
That's weird. I was about to ask the same question on here. I swear I've seen that somewhere in a Linux bootup or installation.
Seems no-one else can find it though.. perhaps it has been lost from recent implementations.
mogorific carpentry experiments
"static" is way underrated.
She?... hrmmm mabe you've got something there... does she have a twinkel in her eye?... for you :)
I don't think so... Besides she tried to hit on one of my co-workers (while his girlfriend was there!) ;-) Besides, I have a girlfriend.
i = i +1; // increment i by 1
Someone suggested this:
[root@morgoth:/usr/src/linux]# egrep -ir "( fuck)|( shit)" *
The best thing that came out was:
arch/sparc/kernel/ptrace.c:/* Fuck me gently with a chainsaw... */
I actually got to see some DOS 2.0 code. In the middle of it, deep deep buried, I found: /* This put here to please my boss, who said:
"DOS isn't done until Lotus won't run."
*/
(see the book "Hard Drive: Bill Gates and the Making of the Microsoft Empire")
Static is a very dangerous construct. Statics are global while the code may eventually find its way into multi-threaded code, or code which has fewer assumptions than some obscure function it relies upon.
This code for example assumes there is only one video card. Of course there isn't enough information here to determine the context of the caller, it is perfectly reasonable to assume that the context could change depending on which video card has been 'selected'.
Indeed, one of my current pet open source project has a comment that reads:
In front of the horrible pile of hacks I had to write to temporarly support a file format I had no specs to and was decoded ad hoc. -- MG
Ok, showing my age ....
Odd Comments and Strange Doings in Unix
"Watch the skies, keep watching the skies"
I remember reading this as part of a warning really. There was a mainframe app, and there was a constant, and it was called BDOLVB. Some maintenance programmers inherited the system, and saw the obove constant, and didn't know what the hell it was. They tried to look it up, figure out what the meaning was, and they couldn't figure it out. They could see what it was set to, 1770 Octal, but didnt know what it meant. They put looking into it on the back-burner - the system worked but they were stil curious about the meaning. Eventually, after months, they found oout what it meant.
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.
With in preparation for the "shared source" licensing (about 1.5 years ago), there was a big push to clean up the Windows source code. All profanities were removed, and it was required to remove all "BUGBUG"s. (BUGBUG basically meant "this code needs work"). Unfortunately, the crackdown on BUGBUGs caused most developers to just switch to a different, nonstandard string, which means such things could no longer be searched for.
This posting is provided "AS IS" with no warranties, and confers no rights.
That doesn't work well because I get too many hits like:
/home/ant/kernels/linux-2.4.20/include/linux/types .h \ /home/ant/kernels/linux-2.4.20/include/asm/io.h \ /home/ant/kernels/linux-2.4.20/include/asm/irq.h \
drivers/gsc/.depend:
drivers/gsc/.depend:
drivers/gsc/.depend:
Binary file arch/i386/kernel/pci-i386.o matches
arch/i386/kernel/.pci-i386.o.flags:ifeq (-D__KERNEL__ -I/home/ant/kernels/linux-2.4.20/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=athlon -nostdinc -iwithprefix include,$(strip $(subst $(comma),:,$(CFLAGS) $(EXTRA_CFLAGS_nostdinc) $(CFLAGS_pci-i386.o))))
Ant(Dude) @ Quality Foraged Links (AQFL.net) & The Ant Farm (antfarm.ma.cx / antfarm.home.dhs.org).
I think it's because they get into a groove where the code is coming right from their stream of consciousness without anything getting in their way. As you go down the bell curve, the programmers have to force their mind into an unfamiliar state to generate code.
This is one of the things that drives me nuts about programming. Some times I will just be in the mood for it. Its hard to explain what exactly this mood is... Im usually a tad tired... But not where you feel really sleepy... (like right now.. ROTFL)... but where you feel zoned out... or not fully present.
When Im in that state, I find my self writing huge amounts of code... When I come back to it the next day... it usually takes me a while to figure out what the heck I wrote =)
Ah well... Im sure my bipolar disorder has a good part to play in this too =)
Luke
sun's java code conventions are hilarious. or maybe i need to get out more.
united states nuclear device terrorist bioweapon encryption cocaine korea syria iran iraq columbia cuba
drivers/message/fusion/mptlan.c
panic("Damn it Jim! I'm a doctor, not a programmer! "
"Oh, wait a sec, I am a programmer. "
"And, who's Jim?!?!\n"
"Arrgghh! We've done it again!\n");
-- Wanna textmode user interface for ruby? http://freshmeat.net/projects/jttui/
forgot the </a>. sorry. //trigger happy submit button presser.
united states nuclear device terrorist bioweapon encryption cocaine korea syria iran iraq columbia cuba
"There are already a million monkeys on a million typewriters, and Usenet is NOTHING like Shakespeare." - Blair Houghton
It was company policy that the first variable would be called...wait for it.....'A'. The next, 'B' and so on, until AA, AB and onwards. Gulp. This was in COBOL, too.
-- And when Justice is gone, there is always... Force. --Laurie Anderson, "Oh Superman"
That doesn't work well because I get too many hits like
That is not a problem with grep, it reports those because the word ant really is there. To avoid that use the grep command on a set of sources which has not yet been used for a compilation, or that has been compiled without that word in the path or machine name.
Do you care about the security of your wireless mouse?
Don't you look at all the code you use line by line to see if there is anything weird in there? Isn't that the reason for using open source? ;^P
I was trying to find out how to clear the history from XUL in mozilla when suddenly ->
/**** No honey, I haven't been visiting any porn sites. ****/
p er /there.is.only.xul"
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
in arch/sparc/mm/srmmu.c
/* dont laugh, static pagetables*/
:)
static int srmmu_check_pgt_cache(int low, int high)
{
return 0;
}
The rest of this file contains a few *interesting* rants against Sun, Fujitsu et al. If you believe them, don't ever buy Sun.
I usually name throwaway variables (1 use loop sentries, string buffers etc) after tv show or movie plot elements. Just as long as the purpose of the variable can be obtained from it's use, on the spot, I give it a 'meaningless' name.
:)
For example:
int vader = strlen(george);
int anakin;
for( anakin = 0 ; anakin vader ; anakin++ )
doSomething( anakin );
char kramer[vader*2] = "\0"
strcpy( kramer, george );
You get the idea.
Huh?
lib/vsprintf.c: * Wirzenius wrote this portably, Torvalds fucked it up :-)
That's my favorite line in the entire kernel!
"Alcohol, Tobacco, Firearms, and Explosives" should be a convenience store, not a government agency.
Yup. Just like me. :) I enjoy the challenge of finding such things - I now do this for a living, not just for fun.
Let me take the time to say that there is such a thing as a device that will never be maintained, such as these. The pieces worked fine for the 18 months we needed them. After that, they'll never need to be maintained again - and can't be, we took the source code and schematics with us. The next team was nearly incompetent and needed to start over, not build on technology they didn't understand.
On my final project for the weed-out^H^H^H^H^H^H^H introductory programming course at my old school, a couple of times I would get something to work, then say, "why did I do that?" Inevitably, I would bollocks it up, then spend hours putting it back right by the same seemingly odd method I used to get it to work originally. Finally, I'd just write this comment:
it tickled me, anyway. LOL
oh brave new world, that has such people in it!
In a government lab I saw a comment like this in code someone ported to C from fortran.
float array[257];
int waste( waste(); waste(); waste(); waste(); waste(); waste(); waste(); waste(); waste(); waste(); waste());
I do not remember the code exactly but it was similiar to this and obviously not ansi c compliant as we know today. I noticed in the early compilers that brackets "{}" were not included. Just parenthesis "()". The link where I got the code is no longer active and perhaps someone reading this could find it elsewhere on the web and link it.
Anyway I found this hilarious because the ancient PDP Dec machines only had like 1-2 megs of ram and most of the memory was reserved for applications. Almost everything was written in assembly due to hardware limitations and wasting memory like this was a complete blashphemy. Programmers just didn't do this back then. THe editor "ed" is an example on how most programs were written and ultra conservative in terms of feautures to reserve ram.
Glad those days are over.
http://saveie6.com/
I was browsing at +3 and didn't grep this...so...here goes:
arch/sparc64/kernel/ptrace.c:/* Fuck me gently with a chainsaw... */
Orange
What kind of funny quotations do you think will show up?
humorous bits of code and comments from linus torvalds' 1991 kernel (version 0.01):
Entertaining Bits from the Ancient Kernel Tree
- Entertaining Bits from the Ancient Kernel Tree
Set your wayback machine to the mid 70's, scenic El Segundo California, home of Scientific Data Systems (bought and torpedoed by Xerox but that's a different story)...
Not only was the vast majority of the systems software for the SDS mainframes written in assembly code, customers actually got the code!
Coding/commenting styles differed greatly. The module which handled all remote batch operations, called RBBAT, was *completely* uncommented. Yet its author and maintainer, Sam, when challenged on this, said, "read me 5 lines from any place in rbbat and I'll tell you where they are and what they do."
I was responsible for some other parts of the operating system. When I saw this thread, I instantly remembered an event from those days -- my boss came into my office and handed me a bug report on my code. Some prudish asshole in Salt Lake City didn't like my comments and had sent in a bug report complaining about them. Ed asked me what I was going to do about it. I told him, not a fucking thing, unless I had the opportunity to visit the customer site. Ed agreed I didn't have to change the comments.
I still have the original PDP-11 assembly source for DEC RMONFB task scheduler, copyright 1975 by Digital Equipment. Almost every new subroutine has comments like: .SBTTL READ/WRITE COMMON ROUTINE
.SBTTL CLOCK INTERRUPT HANDLER
; " 'SO IT DOES!' SAID POOH. 'IT GOES IN!'
; 'SO IT DOES!' SAID PIGLET. 'AND IT COMES OUT!'
; 'DOESN'T IT? SAID EEYORE
; -- A.A. MILNE, "WINNIE THE POOH"
or
; "THE TIME IS OUT
If you make me miserable and unhappy on the job, I am unlikely to make many mistakes because I'll be gone as soon as the notice period is up.
I do not fail; I succeed at finding out what does not work.
Not really kernel code humor per se, but I received this message in apache's error_log yesterday after making a seemingly innocent config change and restarting:
[Sat Jan 4 00:18:55 2003] [error] mod_ssl: Init: (hostname:443) Illegal attempt to re-initialise SSL for server (theoretically shouldn't happen!)
I used to do programming work and remember a similar situation in a daemon I wrote that basically did this:
if($this == $that) {
foo;
fork off;
exit;
} else {
bar;
fork off;
exit;
}
die("Should never reach this far");
I would receive that error about once a month...
/*
* Now, we have to map the power management section to write
* a bit which enables access to the GPIO registers.
* What lunatic came up with this shit?
*/
One joke that I almost always put into my programs is a reference to the MST3K movie. In one scene, one of the bots is trying to dig a tunnel out of the ship back to Earth. Of course, this isn't a terribly effective way to get out of a spaceship, so he goes back to review his notes, and says, "Huh. Breach hull, all die. Even had it underlined."
So my error-catching code always tends to be labeled BHAD.
--AC
And thats just a small sample of some of the most entertaining code I've ever read! And darn good too. I guess they had fun at DEC back in those days.
In a CS class I took in High School, the teacher was running a little program on the projector with a prompt for a first and last name. One of my classmates raised his hand and suggested "Last name 'Hunt' , First name 'Mike'".
Attempting to conceal our laughter, we watched as the clueless teacher repeated the name aloud, then entered it into the program. He wondered why the whole class seemed to be laughing, and whether it had anything to do with this "Mike" -- one intrepid classmate told him that it was a friend of ours who had been kicked out of our school some years ago. The teacher then proceeded to use the same name in the next few iterations of the program.
Guess it just goes to show that teachers think on a different level than their students.
http://cltracker.net -- powerful craigslist multi-city search
At the company I work for, one of the main components of our main software package will run into a little bit of a problem and throw the following into the event log (Windows): "Screw you guys, I'm going home." Always a fun time when a customer calls for support, you tell them to read any errors in the event log and have them read that to you. Most of them tend to like it, in a frightened sort of way.
"Nature doesn't care how smart you are. You can still be wrong." - Richard Feynman
In one job I was responsiable for the code to switch from one redudant peice of hardware to it's backup, and more importantly the code that decided the master was bad. I wrote a comment in 1.0:
// Do we need a witchover?
I noticed it the next day, but left it in because knowing how they worked I decided that a witch was more likely to get the job done then my code.
Amazingly enough switchovers worked fairly well, perhaps I was just too close to the hardware and knew the limitations. I'd like to get another shot at redunadt hardware though to see how if the stupid tricks that we madw work are normal, or if there is a way to make it work that give an engineer confidence that it works.
I read the whole thread and have reached a conclusion: source code comments are not funny. If the funniest thing we can put as a comment is // this should never happen.... perhaps we need to seek an alternate source of comedy.
Ecce Europa - Web Design for Business
I had burned myself out working at a sweatshop (service bureau) doing an accounting program, which was getting more and more balky about running in my 32k bytes I was allowed (I'm an old fart). RSTS/E Basic-plus.
I wrote "Fixed latest problem. Since this is my last day at the company, this is the last time I ever have to work on this misbegotten son of Murphy's law." I was perhaps slightly more colorful in my prose.
1985, 4 years later, at a new job, upon being introduced by name, someone else quoted that comment back to me. He had been the next poor fool to try to do the impossible.
You sez:
"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."
I am NOT disputing your finding.
However, I wish to get your attention to a very tiny piece of embedded code inside Intel's chip, the "EIEIO" register.
So far, I do NOT see Intel's reputation being damaged in any form. On the contrary, the programmers, yes, who are also CUSTOMERS, seems to enjoy it.
You see, the ability to laugh at yourself, or be humorous is a plus.
It distincts ourselves from drones.
Muchas Gracias, Señor Edward Snowden !
Is the word 'fuck' really that bad? I mean, some of those 'fuck's are pretty funny when you put them in context!
Note to M1-ers: a curt but otherwise insightful message is not "Flamebait" or "Troll".
I remember an example of a really bad comment form one of my programming books:
/* horse the string into correctitude... */
IIRC, the book claimed it was from an actual program. Generally speaking, humor is good. However if your comments have sloppy writing, sloppy jokes, and lots of expletives, what can we expect your actual code to look like?
Furry cows moo and decompress.
The comment says in Russian about some far procedure :
20 years of lame.
i pity poor programmers who have to maintain source code where some lamer thought he was 'cute' and 'funny' when after the 2nd reading, it is neither.
Phone number? :-)
Never mind, he's not a troll.... He just linked the wrong place.
.
You have to go to your local forecast then search for !--
Cover your eyes and click this link!
...and the 31,416th version of the kernel, which required the latest glib, which broke all my apps...
"I KNOW NOTHING! NOTHING!" was not Col. Klink's catchphrase (which was "HO-GEN!"), it was Sgt. Shultz's.
www.eFax.com are spammers
My brother's company decided to outsource a critical Internet banking application they were building (always a bad sign) and their first vendor totally blew the project. They considered cancelling, but they finally decided to oursource the project again.
When they received the code base, the product almost worked. However, it had some critical bugs that made it unusable and my brother was on the team to fix those bugs, but he couldn't figure out the code. Fortunately, the programmer(s) had put plenty of comments into the code -- in Spanish.
They unraveled most of the code but got stuck at one section that they couldn't understand and decided to call a Spanish speaking coworker for help. They spelled the comments to him over the phone, but had trouble understanding his response because he couldn't stop laughing. The translation? "... and further into the darkness we go..."
Found this today:
;). ... (To the powers: is there
Memory management
*
* This is a shameless copy from the USB-cpia driver (linux kernel
* version 2.3.29 or so, I have no idea what this code actually does
* Actually it seems to be a copy of a shameless copy of the bttv-driver.
* Or that is a copy of a shameless copy of
* no generic kernel-function to do this sort of stuff?)
*
* Yes, it was a shameless copy from the bttv-driver. IIRC, Alan says
* there will be one, but apparentely not yet -jerdfelt
*
* So I copied it again for the ov511 driver -claudio
*
* Same for the se401 driver -Jeroen
*
* And the STV0680 driver - Kevin
If you suspect something that appears to work, and you can't demonstrate completely whether it is correct or incorrect, by all means flag it.
I once reviewed a function just before release and had a bad feeling about the code. I was quite tired due to overwork, but I've learned to trust my gut. Everything appeared to work correctly, but that doesn't mean there isn't a coding error. But I couldn't satisfy myself that there was no error, and had other things to attack so couldn't really see if there was an error. So I put a warning saying there might be a bug here, check back later.
Eventually I went back and removed the warning, after ensuring the code was indeed OK. But the warning was appropriate, and served its purpose.
--
Marc A. Lepage
Software Developer
I had to do this once.
In Java, you can override clone(). You might do this in all derived classes in a part of your class hierarchy.
In the implementations, you might call super.clone() and cast it to that base class. But, when you call super.clone(), you must catch CloneNotSupportedException.
But clone() must be supported, you implemented it yourself! You know what class you are (at least, you're in that part of the class hierarchy). In this case, you know the clone() you are calling is supported, but the compiler does not.
So that catch block should never happen! (Barring compiler problems etc.) But it must be there. So I just had it print "this should never happen."
--
Marc A. Lepage
Software Developer
Hi,
F -8 &oe=utf-8&selm=be1aeb16.0210050052.838ea12%40posti ng.google.com
Checkout this site for a more comprehensive (?) list of funny linux kernel comments!
http://www.mar00ned.netfirms.com/funny.html
In case you have troubles finding it, check out the perl script used to generate this at:
http://groups.google.com/groups?hl=en&lr=&ie=UT
Love, Peace, Open Source!
Vishal
v==hal if