Slashdot Mirror


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?"

63 of 485 comments (clear)

  1. Is all code like this? by EnderWiggnz · · Score: 5, Funny

    Yes.

    Haven't been working long in the real world, eh?

    --
    ... hi bingo ...
    1. Re:Is all code like this? by saskboy · · Score: 3, Funny

      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.

      --
      Saskboy's blog is good. 9 out of 10 dentists agree.
    2. Re:Is all code like this? by Anonymous Coward · · Score: 3, Funny

      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;".

    3. Re:Is all code like this? by kbrannen · · Score: 5, Funny

      More than you'd initially suspect. :-) I used to work for a Wall Street firm that had the policy that if you worked more than 10 hours a day, they'd buy you dinner. We were on a tight schedule so this was very common for our small team. We rotated the "order dinner" duty around. Anyway, one day several months after the crunch, I was working on some code written by another guy and found something like this in the code. /* thu's order 2 canoli 1 raviloli 1 pepperoni pizza 3 salads 2 chocolate cakes 1 carrot cake 1 bread sticks 3 cokes 1 diet coke */ Looking back thru CVS, I found it had been there a good long while. After a good laugh, I deleted it.

    4. Re:Is all code like this? by Anonymous Coward · · Score: 1, Funny

      I guess embedding the string "!seineew era sreenigne epacsteN" in the binary is what professionals do, then?

      I think if you're at all surprised to see the comments in the Linux kernel, clearly you've never really coded. This article kind of makes me roll my eyes, because the truth is, I've seen (and written) a lot funnier.

    5. Re:Is all code like this? by rootmonkey · · Score: 4, Funny

      I typically listen to music while coding and lyrics find there way into my source code. I used to put weird ramblings in my source just to freak out the other developers. /* Its getting dark on the outer rim,insanity is startint to set in .... */. I've stopped doing that but many programmers put the personal touch on their code via comments.

      --

      Yes but every time I try to see it your way, I get a headache.
    6. Re:Is all code like this? by FireballFreddy · · Score: 4, Funny

      Hehe, but code/comments like this can bite you in the ass too. I remember a developer who was told to add a big red button into a game for kids. For some reason, I believe as a joke, he put in a *huge* red button labeled "BIG FUCKING RED BUTTON".

      Well, the file got propogated to other trees before he could "correct" the button, and during pre-release testing a volunteer was playing the game and lo! the button pops up. :) Too bad it was an adult testing and not a little kid, because that would have been really funny.

      -FF

      --
      SQUEAK, the Death of Rats explained.
    7. Re:Is all code like this? by Anonymous Coward · · Score: 1, Funny

      "something successfully didn't happen"

      comes to mind from my ye ol days

    8. Re:Is all code like this? by BrokenHalo · · Score: 3, Funny

      Funny you should mention this... I remember some (i.e. many) years ago when I was working as a sysprog on a Sperry site, I wrote and implemented a transaction surveillance program called BIG_BROTHER. The CEO got wind of it somehow, and I got carpeted, so I renamed the prog to LARGE_SIBLING. That was OK, for some reason :-)

  2. Yes. by pb · · Score: 5, Funny

    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.
    1. Re:Yes. by danamania · · Score: 5, Funny

      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

    2. Re:Yes. by inode_buddha · · Score: 5, Funny

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

      --
      C|N>K
    3. Re:Yes. by Ryan+Amos · · Score: 3, Funny
      Heh, I do that. Worst part was turning it in with my assignment not remembering that I had left the comment in there.. Code worked fine, it just had a big

      // Note to self, this code written while really fucked up.. go back and check it later

      I'm sure my TA found it rather humorous...

  3. The Tao of Linux by Anonymous Coward · · Score: 5, Funny

    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.

  4. Re:Cool by DaBj · · Score: 5, Funny

    Does naming a temporary boolean variable SchroedingersCat constitute humor?

    If so then, yes, programmers do have humor. (Atleast this one does...)

    --
    "GNU's not Unix....it's Linux" / Kami "kokamomi" Petersen
  5. Linus by DaBj · · Score: 3, Funny

    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
  6. Bolixed. by danamania · · Score: 5, Funny

    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

  7. Hardly by barzok · · Score: 5, Funny

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

  8. Well no, it's not all like that by kfg · · Score: 5, Funny

    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

    1. Re:Well no, it's not all like that by Anonymous Coward · · Score: 1, Funny

      Microsoft's web site for Clippy has a picture of Clippy saying "all your base".

    2. Re:Well no, it's not all like that by PyroX_Pro · · Score: 2, Funny

      Microsoft realized that clippy is dumb. http://www.microsoft.com/office/clippy/ ( The flash, its amusing )

  9. Hardware On Drugs! by mdechene · · Score: 5, Funny

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

    --

    Karma: Not Particularly Funny.
  10. FreeBSD's /usr/src/sys/pci/if_rl.c by flynn_nrg · · Score: 5, Funny

    Bill Paul, the guy who coded the Realtek 8139 driver put a very funny comment:

    /*
    * The RealTek 8139 PCI NIC redefines the meaning of 'low end.' This is
    * probably the worst PCI ethernet controller ever made, with the possible
    * exception of the FEAST chip made by SMC. The 8139 supports bus-master
    * DMA, but it has a terrible interface that nullifies any performance
    * gains that bus-master DMA usually offers.
    *

  11. Re:Anyone remember by sczimme · · Score: 4, Funny


    someone talking about "Kernel Klink" embedded somewhere?

    Of course not - we know NOTH-ING!

    --
    I want to drag this out as long as possible. Bring me my protractor.
  12. Variable Names too.... by RebelTycoon · · Score: 5, Funny

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

    1. Re:Variable Names too.... by YrWrstNtmr · · Score: 3, Funny

      We had one like that recently:

      something to do with revenue in the "pipeline" (future/expected)

      MyPipeFirm
      MyPipeNotFirm

    2. Re:Variable Names too.... by JohnFluxx · · Score: 3, Funny

      I remember someone telling a story (on /. maybe - i forgot) about they called their new program "enis", but the custom was to add a "D" for development, and a "P" for production. They didn't want to ship the customer a product called Penis, so the managers changed it to "Pnis" iirc, which still sounds the sound when pronounced.

  13. The worst I ever saw by cca93014 · · Score: 5, Funny
    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...

  14. Amusing Bits by DarkKnightRadick · · Score: 5, Funny

    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.

    --
    "There is a way that seems right to a man, but its end is the way of death." Proverbs 16:25 (NKJV)
  15. Re:Cool by Anonymous Coward · · Score: 1, Funny

    Does naming a temporary boolean variable SchroedingersCat constitute humor?

    Oh, yea. That's just too funny.

    If your job as a programmer ever goes under, you can always do standup.

  16. Funny printk in die_if_kernel for sparc64 by Etyenne · · Score: 5, Funny

    And colleague and I where working a client E450 when we saw some funny ASCII art in /var/log/messages. At first, we believed that the machine got owned and the cracker was making fun of us. A little grepping later we found it in arch/sparc64/kernel/traps.c die_if_kernel() (around line 1450 for 2.4.18). I'd like to post the snippet, but the lameness filter refuse to let me do so. Go see for yourself.

    BTW, kerneltrap.org comment posting system seem borked ... it ate my post !

    --
    :wq
    1. Re:Funny printk in die_if_kernel for sparc64 by Controllers · · Score: 5, Funny

      #arch/sparc64/kernel/traps.c
      /* Amuse the user. */

      \|/ ____ \|/
      "@'/ .. \`@"
      /_| \__/ |_\"
      \__U_/

      thats hilarious!!!

      --
      You have 30 Moderator Points! Use 'em or lose 'em!
  17. Encourage this! by dmorin · · Score: 5, Funny
    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.
  18. Proper code indentation by Cadre · · Score: 5, Funny

    I ran across this gem awhile ago, been saving it as a text clipping on my desktop for years now waiting for the perfect moment to post:

    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

    --
    All editorial writers ever do is come down from the hill after the battle is over and shoot the wounded.
  19. grep fuck by romkey · · Score: 2, Funny

    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.

  20. Cray-3 compiler declaration by ColonelPanic · · Score: 5, Funny

    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.
  21. some suprises from apps by ElOttoGrande · · Score: 5, Funny
    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 ;)

  22. shutdown.c by almeida · · Score: 3, Funny

    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.

  23. Dutch code! by desaster · · Score: 5, Funny

    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

  24. after I was laid off ... by e1en0r · · Score: 5, Funny

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

  25. What a loser by Little+Grey · · Score: 2, Funny

    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

  26. Any other /. references in Linux kernel? by VZ · · Score: 5, Funny

    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.

    1. Re:Any other /. references in Linux kernel? by echucker · · Score: 5, Funny

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

  27. Ex-girlfriend commentary as assembly line labels by QuasiEvil · · Score: 5, Funny

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

  28. from code I used to work on by ucblockhead · · Score: 5, Funny
    #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.

    --
    The cake is a pie
  29. How about a flow chart? by John+Ineson · · Score: 5, Funny

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

  30. from a professional shop by shortscruffydave · · Score: 5, Funny

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

  31. Half-Life SDK comments by sheetsda · · Score: 5, Funny

    See here and my sig.

  32. Microsoft humour is much more open... by Anonymous Coward · · Score: 1, Funny

    ...the entire OS is the joke.

  33. Sadly, not too much in FreeBSD. by bahwi · · Score: 3, Funny

    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. =)

  34. Grepping kernel src... by hdparm · · Score: 3, Funny
    ...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.

  35. Subliminal messages past column 80 by mikehihz · · Score: 2, Funny

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

  36. Grepping the kernel source code for 'fuck'. by Dthoma · · Score: 2, Funny

    arch/i386/kernel/mtrr.c:1088:/* Some BIOS's are fucked and don't set all MTRRs the same! */

    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 :971: <title>The Fucked Up Sparc</title>

    drivers/cdrom/sbpcd.c:4927: blkdev_dequeue_request(req); /* task can fuck it up GTL */

    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: /* This card is _fucking_ hot... */

    drivers/scsi/NCR53C9x.c:1770: * how bad the target and/or ESP fucks things up.

    drivers/scsi/NCR53C9x.c:2690: /* Be careful, we could really get fucked during synchronous

    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: /* Be careful, we could really get fucked during synchronous

    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: /* Fuck me plenty... */

    fs/jffs/intrep.c:2983: don't fuck up. This is why we have

    include/linux/netfilter_ipv4/ipt_limit.h:1 8: /* Ugly, ugly fucker. */

    include/linux/netfilter_ipv6/ip6t_limit.h:18 : /* Ugly, ugly fucker. */

    lib/vsprintf.c:9: * Wirzenius wrote this portably, Torvalds fucked it up :-)

    net/core/netfilter.c:440: /* James M doesn't say fuck enough. */

    net/ipv4/netfilter/ip_conntrack_core.c:1138: /* This is fucking braindead. There is NO WAY of doing this without

    net/ipv4/netfilter/ip_nat_helper.c:249: /* Grrr... SACK. Fuck me even harder. Don't want to fix it on the

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

  37. Mental note by msobkow · · Score: 5, Funny
    /**
    * Do not accept contracts from D. Smith, as
    * it will lead to a tedious, boring, mind-
    * numbing term in the ninth level of hell.
    * 2002.01.04 MSS
    */
    --
    I do not fail; I succeed at finding out what does not work.
  38. My favorite C variable name by JWhitlock · · Score: 3, Funny

    while (e_coyote)
    {
    /* code goes here */
    }

  39. Re:Cool by MoonBuggy · · Score: 2, Funny

    if( SchroedingersCat == Dead ){
    echo "Naughty physicist, you must have looked";
    } else {
    echo "Well what's the point of the experiment if you don't see what happens?";
    }

  40. Example I found by sheriff_p · · Score: 3, Funny

    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
  41. SQL too by Anonymous Coward · · Score: 1, Funny

    Just reminded me of what my colleague put together yesterday:

    select ..... from ...
    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)

  42. Re:redefines the meaning of 'low end.' by silvaran · · Score: 3, Funny

    Hahaha, melts in your PC, not in your hand...

  43. Re:While in college by green1 · · Score: 2, Funny

    I had a programming instructor in college who taught programming in C on 2 different platforms... our class was working on winblows boxes while the other class worked on some UNIX variant... she gave the same assignment to each class, however due to the differences between the two environments the results came out slightly different (neither one was "wrong" per say... just different spacing on an output file) however the instructor refused to allow for these differences and was grading the assignment by simply comparing the output file of the program with one from her program writen in the other environment. this resulted in many comments in the code in our class allong the lines of "adjustment because our instructor can't tell windows from unix"
    or "adjustment to make my program wrong... but the same wrong as the instructor's program"

    funnily enough nobody lost marks on any of those comments.

  44. Re:You are not expected to understand this by jericho4.0 · · Score: 3, Funny
    That was a good read, and on-topic also, but the most interesting phrase was;
    The very first use of Unix in the "real business" of Bell Labs was to type and produce patent applications
    There's someting both inspiring and disturbing about that.
    --
    "A language that doesn't affect the way you think about programming, is not worth knowing" - Alan Perlis
  45. Colorful Input by schmiddy · · Score: 2, Funny

    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
  46. Funny Error Messages by pyite · · Score: 2, Funny

    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