Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Linux Kernel Code Humor

Posted by CowboyNeal on Sat Jan 04, 2003 01:12 PM
from the this-source-rated-t-for-teen dept.
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?"
This discussion has been archived. No new comments can be posted.
Linux Kernel Code Humor | Log In/Create an Account | Top | 502 comments (Spill at 50!) | Index Only | Search Discussion
Display Options Threshold:
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
(1) | 2
  • Is all code like this? (Score:5, Funny)

    by EnderWiggnz (39214) on Saturday January 04 2003, @01:13PM (#5014730)
    Yes.

    Haven't been working long in the real world, eh?
  • Cool by flapjackboy (Score:1) Saturday January 04 2003, @01:15PM
    • Re:Cool (Score:5, Funny)

      by DaBj (168491) <dabjNO@SPAMdabj.net> on Saturday January 04 2003, @01:17PM (#5014757) Homepage Journal
      Does naming a temporary boolean variable SchroedingersCat constitute humor?

      If so then, yes, programmers do have humor. (Atleast this one does...)
      [ Parent ]
      • Re:Cool by Anonymous Coward (Score:1) Saturday January 04 2003, @01:26PM
        • 1 reply beneath your current threshold.
      • Re:Cool by Anonymous Coward (Score:1) Saturday January 04 2003, @01:46PM
        • 1 reply beneath your current threshold.
      • Re:Cool by MoonBuggy (Score:2) Saturday January 04 2003, @05:57PM
      • Re:Cool by McPierce (Score:1) Sunday January 05 2003, @08:24PM
      • 2 replies beneath your current threshold.
    • Proper code indentation (Score:5, Funny)

      by Cadre (11051) on Saturday January 04 2003, @01:50PM (#5014947) Homepage

      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:

      Halfway down the code there is a comment that looks something like this:

      **SFS 07/05/96** Third day. Still no sign of an indented IF. Food and water is running out and the bearers are getting restless. I think Carruthers is going mad...

      - Shane Smith <Shane.F.Smith@Healthnet.com> on proper code indentation, in comp.os.vms

      [ Parent ]
  • Yes. (Score:5, Funny)

    by pb (1020) on Saturday January 04 2003, @01:15PM (#5014742)
    The best code comment I heard about (in a discussion about code commenting, I believe) was something like this: /*** DRUNK -- FIX LATER! ***/
    • Re:Yes. (Score:5, Funny)

      by danamania (540950) on Saturday January 04 2003, @01:26PM (#5014825)
      I'm just compiling KDE 3.1 - in the middle of part of the code (for KATE the editor I think) is

      warning: why does this work?

      a grrl & her server [danamania.com]
      [ Parent ]
      • We need more comments like this! (Score:5, Interesting)

        by coyote-san (38515) on Saturday January 04 2003, @03:15PM (#5015352)
        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.)
        [ Parent ]
      • Re:Yes. (Score:5, Funny)

        by inode_buddha (576844) on Saturday January 04 2003, @03:45PM (#5015473) Journal
        If you've ever compiled Enlightenment, you'll notice that it checks for Ale in libFridge (before invoking gcc proper), then it flames you for not having any Ale in Fridge...
        [ Parent ]
        • Re:Yes. by Neon Spiral Injector (Score:2) Sunday January 05 2003, @01:07PM
        • 1 reply beneath your current threshold.
      • Re:Yes. by FueledByRamen (Score:2) Sunday January 05 2003, @12:26AM
      • Totally appropriate. by SEGV (Score:1) Monday January 06 2003, @12:32AM
      • 1 reply beneath your current threshold.
    • Re:Yes. by Ryan Amos (Score:3) Saturday January 04 2003, @07:24PM
    • 3 replies beneath your current threshold.
  • The Tao of Linux (Score:5, Funny)

    by Anonymous Coward on Saturday January 04 2003, @01:15PM (#5014743)
    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.
  • Recursive search? by rherbert (Score:1) Saturday January 04 2003, @01:16PM
  • by Gaxx (76064) on Saturday January 04 2003, @01:17PM (#5014759)
    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....
  • Google Cache (Score:5, Informative)

    by Anonymous Coward on Saturday January 04 2003, @01:19PM (#5014769)
    Linked off of article here [google.com].

    Easier to read too.
  • The netcat code by sirket (Score:2) Saturday January 04 2003, @01:19PM
    • Re:The netcat code (Score:5, Interesting)

      by sirket (60694) on Saturday January 04 2003, @01:35PM (#5014868)
      Ahh found the exact line:

      /* linux, which is trying as desperately as the gnu folks can to be POSIXLY_CORRECT. I think I'm gonna hurl... */ -- *Hobbit*, taken from the netcat source

      -sirket
      [ Parent ]
  • Linus (Score:3, Funny)

    by DaBj (168491) <dabjNO@SPAMdabj.net> on Saturday January 04 2003, @01:20PM (#5014775) Homepage Journal
    Is it true that there somewhere in the kernelcode is a comment by Linus saying:

    "//I wonder why this works"?
    • Re:Linus by J0ey4 (Score:1) Saturday January 04 2003, @01:38PM
      • Re:Linus by QuMa (Score:2) Saturday January 04 2003, @02:11PM
        • Re:Linus by QuMa (Score:1) Saturday January 04 2003, @02:13PM
          • Re:Linus by J0ey4 (Score:1) Saturday January 04 2003, @04:40PM
        • Re:Linus by Old Wolf (Score:1) Saturday January 04 2003, @06:32PM
          • Re:Linus by __past__ (Score:1) Saturday January 04 2003, @07:32PM
            • Re:Linus by jericho4.0 (Score:2) Saturday January 04 2003, @08:08PM
              • Re:Linus by __past__ (Score:2) Sunday January 05 2003, @06:18AM
          • 1 reply beneath your current threshold.
      • Re:Linus by Tarpan (Score:1) Thursday January 16 2003, @03:03AM
      • 1 reply beneath your current threshold.
    • Re:Linus by spanky1 (Score:1) Saturday January 04 2003, @01:40PM
      • Re:Linus by naph (Score:1) Saturday January 04 2003, @02:04PM
    • Re:Linus by naph (Score:1) Saturday January 04 2003, @01:59PM
    • Coincidence! by wackybrit (Score:2) Saturday January 04 2003, @06:33PM
    • Re:Linus by kasperd (Score:3) Saturday January 04 2003, @06:50PM
  • Bolixed. (Score:5, Funny)

    by danamania (540950) on Saturday January 04 2003, @01:21PM (#5014787)
    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 [danamania.com]
    • Tac, tac, tac... by CaptainZapp (Score:2) Saturday January 04 2003, @06:24PM
    • Re:Bolixed. by runderwo (Score:2) Saturday January 04 2003, @09:42PM
  • On the fifth day of Xmas my Torvalds gave to me... by Tuxinatorium (Score:1) Saturday January 04 2003, @01:22PM
  • by Anonymous Coward on Saturday January 04 2003, @01:22PM (#5014797)
    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.
  • by kfg (145172) on Saturday January 04 2003, @01:25PM (#5014818)
    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
  • bad bad devs by haukex (Score:1) Saturday January 04 2003, @01:29PM
    • Re:bad bad devs by Anonvmous Coward (Score:2) Saturday January 04 2003, @08:08PM
  • Hardware On Drugs! (Score:5, Funny)

    by mdechene (607874) on Saturday January 04 2003, @01:31PM (#5014853)
    My personal favorite is the "Hardware On Drugs" message.

    cd /usr/src/linux
    grep -r drugs *

    linux-2.4.19/drivers/net/wan/dscc4.c:
    printk(KERN_INFO) "%s: hardware on drugs!\n", dev->name);
  • by flynn_nrg (266463) <mmendez@@@gmail...com> on Saturday January 04 2003, @01:32PM (#5014856) Homepage Journal

    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.
    *

  • at my last job (Score:3, Interesting)

    by pizza_milkshake (580452) on Saturday January 04 2003, @01:33PM (#5014859) Homepage
    i was reprimanded for extensive offensive language in my code. how else to keep it interesting?
  • Funny comments from other systems (Score:5, Interesting)

    by Anonymous Coward on Saturday January 04 2003, @01:36PM (#5014876)
    In the VM subsystem for the Sun-3 kernel, about late 1986 I think, there appeared the following:

    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 ... /* You are not expected to understand this */

    • Re:Funny comments from other systems by Anders (Score:3) Saturday January 04 2003, @02:42PM
      • Re:Funny comments from other systems (Score:4, Informative)

        by taniwha (70410) on Saturday January 04 2003, @05:51PM (#5016028) Homepage Journal
        but the funny thing was that it made lots of sense .... I did a V6 port (a long time ago and to the Vax no less) and worried about that line over and over again ..... I'd keep coming back to it and puzzle and worry over it .... one day I got there and it made absolute sense .... I'd won! .....

        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'.

        [ Parent ]
    • Re:Funny comments from other systems by Risc_0 (Score:1) Saturday January 04 2003, @04:00PM
    • Re:Funny comments from other systems by Guy Harris (Score:2) Saturday January 04 2003, @09:19PM
    • 1 reply beneath your current threshold.
  • Variable Names too.... (Score:5, Funny)

    by RebelTycoon (584591) on Saturday January 04 2003, @01:39PM (#5014887) Homepage
    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 ...
  • BeOS kernel API by fintler (Score:1) Saturday January 04 2003, @01:41PM
  • by corebreech (469871) on Saturday January 04 2003, @01:42PM (#5014898) Journal
    One function gets a +1, Insightful.

    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 /. posts, I think it's OK to moderate down API calls. How are these people ever going to learn otherwise?
  • Ok, what's interesting is: (Score:3, Interesting)

    by dagg (153577) on Saturday January 04 2003, @01:43PM (#5014910) Journal
    This guy was looking for something that was:

    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)

    by cca93014 (466820) on Saturday January 04 2003, @01:43PM (#5014911) Homepage
    while working on a large (more than 3 million Sterling worth) financial risk system I found a comment that read:
    /* The following code demonstrates a complete and utter lack of professionalism. */
    The contractator that wrote it was long gone by the time anyone noticed it...

  • Amusing Bits (Score:5, Funny)

    by DarkKnightRadick (268025) <jnagyjr@joseph-a-nagy-jr.us> on Saturday January 04 2003, @01:44PM (#5014912) Homepage Journal
    I was compiling Perl 5.8 when I found these funny little tidbits:

    From Perl 5.8.0's ./Configure:
    "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 ./configure stages of compiling the source.
    • Re:Amusing Bits by Kourino (Score:1) Saturday January 04 2003, @05:33PM
      • Re:Amusing Bits by DarkKnightRadick (Score:1) Saturday January 04 2003, @06:14PM
  • by Etyenne (4915) on Saturday January 04 2003, @01:48PM (#5014932)

    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 !

  • Encourage this! (Score:5, Funny)

    by dmorin (25609) <dmorin AT gmail DOT com> on Saturday January 04 2003, @01:50PM (#5014942) Homepage Journal
    Ya know, I'll take goofy comments over no comments anyday. As long as somebody can come along later and understand what you meant, it's fine. If having fun with it causes you to write a small explanatory paragraph rather than just writing things like "Added new feature", everybody wins.

    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.

    • char *dummy = ... ; ... free(dummy); // Because hey, free dummy.
    • History: Took out previous feature. I have no idea what I was smoking. I'm really very, very sorry.
    • And Lo, there came forth a Great Renaming, wherein the Lord did provide a mighty shellscript, and it did crunch upon the code for forty megs and forty bytes, and on the last day, all occurences of the expression "oldCompanyName" had become "newCompanyName", forever and ever, amen.
  • grep fuck by romkey (Score:2) Saturday January 04 2003, @01:51PM
  • Cray-3 compiler declaration (Score:5, Funny)

    by ColonelPanic (138077) <pmk.cray@com> on Saturday January 04 2003, @01:52PM (#5014957)
    While working for a loony British midget at Cray Computer Corporation, I put the declaration "short volatile *VP;" into the compiler's optimization phase.
  • some suprises from apps (Score:5, Funny)

    by ElOttoGrande (183478) on Saturday January 04 2003, @01:53PM (#5014960)
    Once was compiling xscreensaver and for some reason didnt have bc library installed...

    configure: error: Your system doesn't have "bc", which has been a standard
    part of Unix since the 1970s. Come back when your vendor
    has grown a clue.

    and one from the slackware adduser script..

    ~# adduser

    Login name for new user []:
    Come on, man, you can't leave the login field empty...

    i also remember a good one in the enlightenment configure script though i dont have it saved .. something about searching the -lfridge for lager ;)

  • malloc by Anonymous Coward (Score:1) Saturday January 04 2003, @01:54PM
    • Re: malloc by Fweeky (Score:2) Saturday January 04 2003, @02:40PM
      • Re: malloc by joto (Score:2) Saturday January 04 2003, @06:08PM
        • Re: malloc by Fweeky (Score:2) Saturday January 04 2003, @06:38PM
      • 1 reply beneath your current threshold.
  • Not all, but a lot by Syphonius (Score:2) Saturday January 04 2003, @01:57PM
  • shutdown.c (Score:3, Funny)

    by almeida (98786) on Saturday January 04 2003, @01:59PM (#5014993)
    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.
  • Dutch code! (Score:5, Funny)

    by desaster (125558) on Saturday January 04 2003, @02:01PM (#5015008)
    Here's my favourite part of the Blender source:

    #ifdef WIN32
    static int is_a_really_crappy_nvidia_card(void) {
    static int well_is_it= -1; /* Do you understand the implication? Do you? */
    if (well_is_it==-1)
    well_is_it= (strcmp((char*) glGetString(GL_VENDOR), "NVIDIA Corporation") == 0);

    return well_is_it;
    }
    #endif
  • after I was laid off ... (Score:5, Funny)

    by e1en0r (529063) on Saturday January 04 2003, @02:06PM (#5015033) Homepage
    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();
    }
  • What a loser by Little Grey (Score:2) Saturday January 04 2003, @02:10PM
  • by VZ (143926) on Saturday January 04 2003, @02:10PM (#5015049)
    I wonder why nobody has mentioned this:

    % sed -n 2,5p ./net/core/netfilter.c
    * 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.
    • by echucker (570962) on Saturday January 04 2003, @03:25PM (#5015392) Homepage
      % sed -n 2,5p ./net/core/netfilter.c
      * 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 ;-)
      [ Parent ]
  • Especially in code that uses MFC by Mr. Sketch (Score:2) Saturday January 04 2003, @02:10PM
  • A Freudian slip? by naph (Score:1) Saturday January 04 2003, @02:11PM
  • Strangely enough ... (Score:4, Interesting)

    by Aceticon (140883) on Saturday January 04 2003, @02:12PM (#5015063)
    ... (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 .
  • Some true gems by jongus (Score:2) Saturday January 04 2003, @02:14PM
  • Some of mine... by BoneFlower (Score:2) Saturday January 04 2003, @02:14PM
  • PHP code offers humour. by fleppir (Score:1) Saturday January 04 2003, @02:17PM
    • SQL too by Anonymous Coward (Score:1) Saturday January 04 2003, @06:17PM
    • 1 reply beneath your current threshold.
  • Assembly Comment by Amstel (Score:1) Saturday January 04 2003, @02:18PM
  • by QuasiEvil (74356) on Saturday January 04 2003, @02:21PM (#5015114)
    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. :)

    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 :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.

    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)

    by ucblockhead (63650) on Saturday January 04 2003, @02:22PM (#5015120) Homepage Journal
    #ifdef THOSE_BASTARDS_CHANGE_THE_SPEC_BACK_AGAIN
    // lots of code
    #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)

    by John Ineson (538704) on Saturday January 04 2003, @02:23PM (#5015126) Homepage
    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]
    *
  • Funny Code by afabbro (Score:2) Saturday January 04 2003, @02:23PM
  • A few snippets... by La Temperanza (Score:2) Saturday January 04 2003, @02:27PM
    • 1 reply beneath your current threshold.
  • The purpose of comments is to be USEFUL... by dpbsmith (Score:2) Saturday January 04 2003, @02:30PM
  • from a professional shop (Score:5, Funny)

    by shortscruffydave (638529) on Saturday January 04 2003, @02:30PM (#5015167) Homepage
    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.

    One member of the team has a reputation for doing useful but wacky things, and most of examples of his code were prefixed with /* Trust me...I know what I'm doing */

    At some point a bug-fix had been applied by a junior programmer, prefixed by /* don't trust me...I may not know what he was doing */
    • 1 reply beneath your current threshold.
  • Code Comments by Beatlebum (Score:1) Saturday January 04 2003, @02:39PM
  • PalmOS programming by ardiri (Score:1) Saturday January 04 2003, @02:42PM
  • Half-Life SDK comments (Score:5, Funny)

    by sheetsda (230887) <doug,sheets&gmail,com> on Saturday January 04 2003, @02:43PM (#5015231)
    See here [thewavelength.net] and my sig.
  • Can't beat this in a production environment by Majik (Score:1) Saturday January 04 2003, @02:43PM
  • Microsoft humour is much more open... by Anonymous Coward (Score:1) Saturday January 04 2003, @02:46PM
  • printer error "on fire" now gone. by cant_get_a_good_nick (Score:2) Saturday January 04 2003, @02:51PM
  • Printer On Fire! by chill (Score:2) Saturday January 04 2003, @02:59PM
  • Happy Meal Ethernet by endrek (Score:1) Saturday January 04 2003, @03:19PM
  • by bahwi (43111) <incoming AT josephguhlin DOT com> on Saturday January 04 2003, @03:26PM (#5015399) Homepage
    Not too much in FreeBSD running the same tests. (Yes, I have nothing better to do today, thank you). (Results white-space edited)

    Under /usr/src/sys/
    $ 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 /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. =)
  • Horse & Pig reference in Kernel 2.4.20 by antdude (Score:2) Saturday January 04 2003, @03:51PM
  • found again and again.... by rookee (Score:1) Saturday January 04 2003, @03:52PM
  • Grepping kernel src... (Score:3, Funny)

    by hdparm (575302) on Saturday January 04 2003, @03:52PM (#5015513) Homepage
    ...is indeed amusing, especially when you just woke up, drinking first coffee. Few favourites (comments):

    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.

  • We paid a guy to sanitize our code by saarbruck (Score:1) Saturday January 04 2003, @04:06PM
  • While in college by Cyb3r (Score:1) Saturday January 04 2003, @04:08PM
  • Subliminal messages past column 80 by mikehihz (Score:2) Saturday January 04 2003, @04:08PM
  • The best I've seen... by hardcode (Score:1) Saturday January 04 2003, @04:17PM
  • Older post of this by autocracy (Score:2) Saturday January 04 2003, @04:33PM
  • Grepping the kernel source code for 'fuck'. by Dthoma (Score:2) Saturday January 04 2003, @04:37PM
  • personal experience by morgajel (Score:2) Saturday January 04 2003, @04:46PM
    • 1 reply beneath your current threshold.
  • Burning Printers (Score:3, Informative)

    by Alien54 (180860) on Saturday January 04 2003, @04:58PM (#5015804) Journal
    The full story on Burning Printers can be seen here [theaimsgroup.com]

    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)

    by Drakonian (518722) on Saturday January 04 2003, @05:16PM (#5015871) Homepage
    This is ironic. Yesterday, I was enraged at the embedded system compiler I was using and put in a very large ASCII art warning against doing something that you SHOULD be allowed to do that took 30 hours to debug.

    If you ever need ASCII art comments, head here:
    ASCII Generator [network-science.de]. It can use many different "fonts". Great utility.

  • Funniest Comment I came across by adamy (Score:1) Saturday January 04 2003, @05:26PM
  • The Better the Code the More Colorful the Comments by Greyfox (Score:2) Saturday January 04 2003, @05:34PM
  • For dummies... by dacarr (Score:2) Saturday January 04 2003, @05:48PM
    • Re:For dummies... by cant_get_a_good_nick (Score:1) Saturday January 04 2003, @07:31PM
  • Error 1109: There is no message for this error. by Simon Brooke (Score:2) Saturday January 04 2003, @06:02PM
  • Example I found (Score:3, Funny)

    by sheriff_p (138609) on Saturday January 04 2003, @06:06PM (#5016077)
    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.

  • Actual comment I have seen by sankoz (Score:1) Saturday January 04 2003, @07:03PM
  • Funny comment by nukey56 (Score:1) Saturday January 04 2003, @07:13PM
  • I think every Real Programmer does it. by Montreal Geek (Score:2) Saturday January 04 2003, @07:41PM
  • You are not expected to understand this by Capt. Mubbers (Score:1) Saturday January 04 2003, @08:03PM
  • Mainframe humor: BDOLVB (Score:4, Interesting)

    by cant_get_a_good_nick (172131) on Saturday January 04 2003, @08:09PM (#5016705)
    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.
  • Microsoft's approach to comments by danshapiro (Score:1) Saturday January 04 2003, @08:16PM
  • panic: I'm a doctor, not a programmer! by jtra (Score:1) Saturday January 04 2003, @08:22PM
  • You don't audit the code you use? by krismon (Score:1) Saturday January 04 2003, @08:50PM
  • Sparc Code by caelyx (Score:1) Saturday January 04 2003, @09:09PM
  • Variable Names by wideBlueSkies (Score:1) Saturday January 04 2003, @09:15PM
  • lib/vsprintf.c.... by Kymermosst (Score:2) Saturday January 04 2003, @09:17PM
  • I can relate, a little by jhylkema (Score:1) Saturday January 04 2003, @09:32PM
  • Dennis Ritchie's ancient 1973 c compiler by Billly Gates (Score:2) Saturday January 04 2003, @10:08PM
  • Another one... by OrangeHairMan (Score:2) Saturday January 04 2003, @10:10PM
  • Linus started it... by option8 (Score:2) Saturday January 04 2003, @10:36PM
  • The more things change... by sillivalley (Score:1) Saturday January 04 2003, @10:44PM
  • Theoretically shouldn't happen! by fo0bar (Score:2) Saturday January 04 2003, @11:53PM
  • from arch/i386/kernel/setup.c by robzster1977 (Score:1) Saturday January 04 2003, @11:55PM
  • Breach Hull, All Die by allanc (Score:1) Saturday January 04 2003, @11:56PM
  • Colorful Input by schmiddy (Score:2) Sunday January 05 2003, @12:18AM
  • Funny Error Messages by pyite (Score:2) Sunday January 05 2003, @12:28AM
  • I'm not pagan, just the hardware by bluGill (Score:2) Sunday January 05 2003, @12:55AM
  • Sorry! by cookiepus (Score:1) Sunday January 05 2003, @01:53AM
    • 1 reply beneath your current threshold.
  • how not to comment your code by MegaFur (Score:2) Sunday January 05 2003, @04:08AM
  • Russian comments in Oracle by franticek (Score:1) Sunday January 05 2003, @05:05AM
  • die by dickens (Score:1) Sunday January 05 2003, @12:27PM
  • /usr/src/linux/drivers/usb/stv680.c by Evil-G (Score:1) Sunday January 05 2003, @03:08PM
  • Re:Is all code like this? by sapped (Score:1) Saturday January 04 2003, @01:24PM
  • Hardly (Score:5, Funny)

    by barzok (26681) on Saturday January 04 2003, @01:24PM (#5014808)
    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".
    [ Parent ]
    • Re:Hardly by Xerithane (Score:2) Saturday January 04 2003, @01:59PM
    • 1 reply beneath your current threshold.
  • Re:Is all code like this? by 2000 Britneys (Score:2) Saturday January 04 2003, @01:26PM
    • 1 reply beneath your current threshold.
  • Re:Is all code like this? (Score:3, Funny)

    by saskboy (600063) on Saturday January 04 2003, @01:27PM (#5014834) Homepage Journal
    Do you remember about that software package that was mentioned on /. about the coder that was fired for putting a comment on the "help" button:
    "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.
    [ Parent ]
  • Re:Is all code like this? by Webmonger (Score:2) Saturday January 04 2003, @01:33PM
  • Re:Anyone remember (Score:4, Funny)

    by sczimme (603413) on Saturday January 04 2003, @01:35PM (#5014869)

    someone talking about "Kernel Klink" embedded somewhere?

    Of course not - we know NOTH-ING!
    [ Parent ]
  • Re:Is all code like this? (Score:5, Informative)

    by KMitchell (223623) on Saturday January 04 2003, @01:36PM (#5014871)
    Um, I have to disagree with this. It really depends on the shop. If by professional you mean formal code reviews by peers, perhaps that would limit some of this stuff. Knowing that you have to stare down a bunch of co-workers is a pretty good way to cause self-censure. Even then it really depends on the attitudes of the people that are going to be looking at your code. Some groups are really anal about comments and others couldn't care less if the code works.


    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 ;)

    [ Parent ]
  • Re:Is all code like this? (Score:3, Funny)

    by Anonymous Coward on Saturday January 04 2003, @01:36PM (#5014877)
    Not really. I had a boss once whom I could tell had been fiddling with my code by the off-color comments.

    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;".
    [ Parent ]
  • Re:Is all code like this? (Score:3, Insightful)

    by Hayzeus (596826) on Saturday January 04 2003, @01:36PM (#5014878) Homepage
    Provided the language is inoffensive, this is simply not the case with most outfits.

    No comments at all are (rightly) far more likely to get you fired.

    [ Parent ]
  • Re:Is all code like this? (Score:3, Informative)

    by FlemLion (572837) on Saturday January 04 2003, @01:39PM (#5014886) Homepage
    Only in a politically correct going to the uncivilized country will this lead to someone getting fired. What's the problem with some extra comment ?
    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 ... there is the bikini, in Iran

    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.
    [ Parent ]
  • by jdkane (588293) on Saturday January 04 2003, @01:42PM (#5014909)
    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.
    [ Parent ]
  • he's trolling, no such comments there (nt) by xintegerx (Score:1) Saturday January 04 2003, @02:02PM
    • 1 reply beneath your current threshold.
  • Re:Is all code like this? by Anonymous Coward (Score:1) Saturday January 04 2003, @03:11PM
  • Re:The Recipe for Creative Code Comments by Wonko the Sane (Score:1) Saturday January 04 2003, @10:07PM
  • NOT a troll by xintegerx (Score:1) Sunday January 05 2003, @09:20AM
  • 20 replies beneath your current threshold.
(1) | 2