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

204 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 Ponty · · Score: 3, Informative

      If yours is, you won't either. I've heard of a few people who've gotten burned by sexist/offensive comments in their code.

    2. Re:Is all code like this? by 2000+Britneys · · Score: 2, Interesting

      Right and the folks who developed windows code base and applications for M$ are highly professional?

      what about the hidden games in MS Office and developers fun page in one of windows OSes?

      talking bout "highly professional" developers here!!!!!!

    3. 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.
    4. Re:Is all code like this? by Webmonger · · Score: 2

      Not. Netscape had to spend a bunch of time preparing their code for outside eyes when they open-sourced Mozilla.

    5. Re:Is all code like this? by KMitchell · · Score: 5, Informative
      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 ;)

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

    7. Re:Is all code like this? by Hayzeus · · Score: 3, Insightful
      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.

    8. Re:Is all code like this? by FlemLion · · Score: 3, Informative

      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.

    9. Re:Is all code like this? by qengho · · Score: 2

      the coder that was fired for putting a comment on the "help" button

      How about the coder that was fired because he left a test name in a database? This guy was working on a mail merge program for some financial house and used "Rich Bastard" as the default name for accounts. Unfortunately, he forgot to remove it and a bunch of letters went out to investors ("Dear Rich Bastard, We value your business blah blah blah").

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

    11. Re:Is all code like this? by netsharc · · Score: 2

      !!!seineew era sreenigne epacsteN

      (J/K, Mozilla rules!)

      --
      What time is it/will be over there? Check with my iPhone app!
    12. 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.
    13. Re:Is all code like this? by jaavaaguru · · Score: 3, Insightful

      The differnece between "12 hours working on it" and "12 hours fsking with it" shows how difficult the problem was to solve, and as far as I'm concerned could be useful to someone else looking at the code later. Leaving it in is only an option with code that stays in-house I guess.

    14. Re:Is all code like this? by JohnFluxx · · Score: 2

      Heh. Where I worked for a while we were just the researchers. This meant that we did the research, wrote the code, wrote up what the code did and how, then deleted the code and sent the description of the code to some secret underground lab with teams of genetically modified professional coders. (Actually I have no idea who did the 'real' coding - it just wasn't us - none of our code was allowed anywhere near what the code was deployed on :)

    15. Re:Is all code like this? by Fweeky · · Score: 2
      (like I've got nothing better to do than faff around aligning +es and |es and \en and similar cack, FFS)

      boxes(1) will draw these for you. par(1) will (try to) fix broken ones.
    16. 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.
    17. Re:Is all code like this? by GlassHeart · · Score: 3, Insightful
      Is it just me, or do the words "professional" and/or "mature," when they occur next to "programmer," actually mean "conservative," or "humorless," or "full of him/herself?"

      Humor can co-exist with professionalism. However, source code is not where you put it. If you ever release that code to a customer, it could damage your company's reputation. Too many such comments could interfere with efforts to search the source code. Humor also often language- and culture-dependent, so your company's foreign employees may even misunderstand subtle jokes as actual useful comments about the code. And then it's no longer funny.

      Not to say that many such coding standards are little more than power trips. However, a professional will always keep in mind the fact that the source code doesn't belong to him or her. If you don't like the rules set by your employer, find another job.

    18. Re:Is all code like this? by sconeu · · Score: 2

      In the defense world, too...

      We did artillery stuff. In technical parlance, guns are called "fire units". My boss told me about the time he wrote up a "fire unit check" routine in all innocence, and was told to rename it...

      Then there were other fun things, such as SEXBUG, and one of my favorites, BANANA. There was a routine called "ACCESS" and another called "ACESS". This lead to confusion, hence BANANA ("By Any Name ACESS Not ACCESS").

      Then theres the one a buddy of mine wrote (in assembly): Dude_You_Just_Nuked_The_Hard_Disk

      I commonly wrote routines for filters labelled "snarf_in" and "barf_out", and my copyright notice code was titled "so_there()".

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    19. Re:Is all code like this? by richie2000 · · Score: 2

      Did you ever put "You talk of times of peace for all, and then prepare for war." from a Midnight Oil song into any of your code? And if you did, would you admit it? ;-)

      --
      Money for nothing, pix for free
    20. 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 :-)

    21. Re:Is all code like this? by Cro+Magnon · · Score: 2

      Someone at my job got bit by something similar. Someone else was testing his stuff and a message came up "If you got here, something is seriously fscked up". Management was not amused, especially since the exact word wasn't "fsck"!

      --
      Slow down, cowboy! It has been 4 hours since you last posted. You must wait another few hours.
  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...

    4. Re:Yes. by FueledByRamen · · Score: 2

      Ever compiled Mozilla? (Well don't, it's like watching grass grow).

      The name of the image handling library is libpr0n.
      Suddenly, it all makes sense...

      --
      Every cloud has a silver lining (except for the mushroom shaped ones, which have a lining of Iridium & Strontium 90)
    5. Re:Yes. by Neon+Spiral+Injector · · Score: 2

      You can disable this check by passing --without-sense-of-humor to ./configure.

  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.

    1. Re:The Tao of Linux by plover · · Score: 2
      die LIST
      Outside an eval, prints the value of LIST to STDERR and exits with the current value of $! (errno). If $! is 0, exits with the value of ($? >> 8) (backtick `command` status). If ($? >> 8) is 0, exits with 255. Inside an eval(), the error message is stuffed into $@ and the eval is terminated with the undefined value. This makes die the way to raise an exception.

      Equivalent examples:

      die "Can't cd to spool: $!\n" unless chdir '/usr/spool/news'; chdir '/usr/spool/news' or die "Can't cd to spool: $!\n"

      If the value of EXPR does not end in a newline, the current script line number and input line number (if any) are also printed, and a newline is supplied. Note that the ``input line number'' (also known as ``chunk'') is subject to whatever notion of ``line'' happens to be currently in effect, and is also available as the special variable $.. See $/ in the perlvar manpage and $. in the perlvar manpage.

      Hint: sometimes appending ", stopped" to your message will cause it to make better sense when the string "at foo line 123" is appended. Suppose you are running script ``canasta''.

      die "/etc/games is no good"; die "/etc/games is no good, stopped";

      produce, respectively

      /etc/games is no good at canasta line 123. /etc/games is no good, stopped at canasta line 123.

      See also exit(), warn(), and the Carp module.

      If LIST is empty and $@ already contains a value (typically from a previous eval) that value is reused after appending "\t...propagated". This is useful for propagating exceptions:

      eval { ... }; die unless $@ =~ /Expected exception/;

      If $@ is empty then the string "Died" is used.

      die() can also be called with a reference argument. If this happens to be trapped within an eval(), $@ contains the reference. This behavior permits a more elaborate exception handling implementation using objects that maintain arbitrary state about the nature of the exception. Such a scheme is sometimes preferable to matching particular string values of $@ using regular expressions. Here's an example:

      eval { ... ; die Some::Module::Exception->new( FOO => "bar" ) }; if ($@) { if (ref($@) && UNIVERSAL::isa($@,"Some::Module::Exception")) { # handle Some::Module::Exception } else { # handle all other possible exceptions } }

      Because perl will stringify uncaught exception messages before displaying them, you may want to overload stringification operations on such custom exception objects. See the overload manpage for details about that.

      You can arrange for a callback to be run just before the die does its deed, by setting the $SIG{__DIE__} hook. The associated handler will be called with the error text and can change the error message, if it sees fit, by calling die again. See $SIG{expr} in the perlvar manpage for details on setting %SIG entries, and eval BLOCK for some examples. Although this feature was meant to be run only right before your program was to exit, this is not currently the case--the $SIG{__DIE__} hook is currently called even inside eval()ed blocks/strings! If one wants the hook to do nothing in such situations, put

      die @_ if $^S;

      as the first line of the handler (see $^S in the perlvar manpage). Because this promotes strange action at a distance, this counterintuitive behavior may be fixed in a future release.

      --
      John
    2. Re:The Tao of Linux by Banjonardo · · Score: 2
      Or, for the entire history of the Tao, read The Gospel of Tux

      --

      -----

      Score 3? For what? Being wrong, at length? - smirkleton

  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. Diary (and calendar) of a die-hard programmer by Gaxx · · Score: 4, Interesting

    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
  6. Google Cache by Anonymous Coward · · Score: 5, Informative

    Linked off of article here.

    Easier to read too.

  7. The netcat code by sirket · · Score: 2

    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

    1. Re:The netcat code by sirket · · Score: 5, Interesting

      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

  8. 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
    1. Re:Linus by QuMa · · Score: 2, Insightful
      • C99 Allows // style comments
      • The linux kernel isn't written to be cross-compiler, it's written to work with GCC. And any other compilers it works with are either modifications of GCC or have put a lot of work into acting like GCC.
    2. Re:Linus by kasperd · · Score: 3, Informative

      "//I wonder why this works"?

      I couldn't find exactly that comment. This is as close as I can get:

      grep -ir 'wonder.*work' linux
      linux/net/ipv4/arp.c: I wonder why people believe that they work.
      linux/drivers/acorn/block/fd1772.c: * code - I wonder if it will still work... No :-)
      linux/drivers/nubus/nubus.c: * I wonder how the CRC is meant to work -

      --

      Do you care about the security of your wireless mouse?
    3. Re:Linus by jericho4.0 · · Score: 2

      Huh?? OK that's a joke, then. For anyone who's wondering, the Linux kernel is almost all C. If not all C. The rest of linux (the apps, tools, etc) are 80% C and most of the rest being C++, plus a little Obj-C and the like.

      --
      "A language that doesn't affect the way you think about programming, is not worth knowing" - Alan Perlis
    4. Re:Linus by __past__ · · Score: 2

      AFAIK there are actually some C++ sources in the Linux kernel, but that's not what I was talking about. I referred to the GCC extensions (as in "embrace and extend"?) it depends on. You can't just take any standards compliant C compiler and expect Linux to compile cleanly with it.

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

    1. Re:Bolixed. by runderwo · · Score: 2
      The first I knew about it was an error along the lines of "device is bolixed".
      Just for the sake of pedantry, "bollocksed" is the correct spelling. :)
  10. Sometimes, and it can cause problems too. by Anonymous Coward · · Score: 5, Interesting

    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.

    1. Re:Sometimes, and it can cause problems too. by coyote-san · · Score: 4, Insightful

      The saddest thing is that the managers will never understand that they're responsible for their own problems. There are a lot of valid reasons for easing somebody out of the door, but the style of comments acceptable at the company before the merger is not one of them.

      N.B., I am not defending comments that are abusive to coworkers, slanderous, etc. That type of language has no place in an office.

      But the tone of a comment is a valuable indication of how much effort was put into fixing it. If I see a comment like // workaround, some_library_call() isn't working like advertised

      it tells me that they RTFM but found a workaround. Maybe a future version of the library (or the FM) will get it right. I probably don't need to talk to the author before touching the code myself. In contrast, a comment like // fucking windows refuses to allow us to keep both widgets visible at the same time, so we'll do this instead...

      tells me that they put a lot of effort into finding a solution to the problem, but every attempt failed. If I have an idea, I should talk to the author to see if he's already tried it. (Better yet would be a pointer to some internal document detailing everything they tried.)

      This isn't absolute - many people will never let their comments contain any emotional tone, and others will swear at the slightest problem. But it's a valuable tool when it's used properly.

      (Speaking of bugs, why does slashcode insist on merging paragraphs?)

      --
      For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
    2. Re:Sometimes, and it can cause problems too. by RetroGeek · · Score: 3, Informative

      a tie is a most useless piece of cloth

      History of the tie

      --

      - - - - - - - - - - -
      I am a programmer. I am paid to produce syntax not grammar. Deal with it.
    3. Re:Sometimes, and it can cause problems too. by sasami · · Score: 2

      No, dress is not itself the issue.

      A dress code is obviously required in some contexts. Less so in others. I'll dress for a customer meeting, but if a company inflexibly insists on enforcing the policy everywhere -- policy for policy's sake -- what does that say about their culture and management?

      Stories abound where policy or management has foiled:

      - Ergonomics and working conditions: "In the meantime, my doctor recommended that I spread my keyboarding out over the weekends. I was to work 4 hours per day Friday through Monday, as opposed to 8 hours on Friday and Monday. Microsystems countermanded my doctor's orders, stating that they wanted me to rest my wrists on the weekends." Then illegally fires him while he's on scheduled disability leave.

      - Product design Engineer is fired for not doing what he's been forbidden to do.

      - Responsible planning: IT manager notices paper prices go up next month, so orders a 6-month supply in advance. Boss forces her to return it all and pay restocking fees. More important to follow the "budget" than to save money!

      - Risk management and employee safety: Consultant wants webmail so he doesn't have to carry a laptop back and forth to a client in a seedy district. But laptop owners are not allowed to have webmail because they already "have" email. IT says: "It's company policy that we would rather lose a $1,600 laptop than to give you a free Web-based e-mail client."

      - Can't even categorize this one: "'Why is the wrong day's backup tape in the server?' boss asks. IT admin points out that the backup system hasn't worked in two years, so why waste the time? Wrong, says boss: 'Just because it doesn't work, doesn't mean we don't put the tapes in there.'"

      And these are just the few I remember lately. A strict dress code isn't inherently a disaster, but it's a warning sign. (In this economy, though, it's not a showstopper anymore. You take what you can get.)

      ---
      Dum de dum.

      --
      Freedom is not the license to do what we like, it is the power to do what we ought.
    4. Re:Sometimes, and it can cause problems too. by Speedy8 · · Score: 2

      When in business has anything been fair? We don't all get the same pay, we dont' all have the same responcibilities, nothing in a company is equal... unless you are apart of a union or a communist/socialist.

    5. Re:Sometimes, and it can cause problems too. by RetroGeek · · Score: 2

      More important to follow the "budget" than to save money!

      There was a multi-million contract to repair the sewers. Next year the budget called for repairing the water line. Both sewer and water line were routed down the middle of the street.

      To repair the sewer the contractor ripped up the street, dug down, and repaired the sewer. While he was down there he noticed that the water line had also been exposed.

      He went back to the owner and said: "For a few dollars more I can fix the water line".

      The answer? No WAY. The sewer contract used up this years budget and there is no money.

      Saving pennies, throwing away dollars.....

      Um yes, this was a government contract. Your tax dollars at work.

      --

      - - - - - - - - - - -
      I am a programmer. I am paid to produce syntax not grammar. Deal with it.
    6. Re:Sometimes, and it can cause problems too. by kasperd · · Score: 2

      which probably means "scary".

      The most scary one I ever got was on a RH7.1 system. After upgrading a lot of RPM packages, I sudenly started getting the "Self-destruct in 5 seconds. Have a nice day..." message. That was one of the error messages I was hoping never to see.

      --

      Do you care about the security of your wireless mouse?
    7. Re:Sometimes, and it can cause problems too. by Reziac · · Score: 3, Interesting

      idSoftware had a little util called "unfuck" that they would apply to their source before sending it off to the latest licensee. Gee, I wonder why? :)

      Somewhere in one of the Paradox 3.5 for DOS executables, someone left a brief rant on upper management (it's readable text in the executable). Betcha that was some interesting source...

      --
      ~REZ~ #43301. Who'd fake being me anyway?
  11. 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".

    1. Re:Hardly by Xerithane · · Score: 2

      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.

      That is frighteningly similar to something I wrote in some code a couple years back. It was never anything that would have left the office. At least I hope not. It was one of those "Here ya go, you have till 5pm" projects. I've also posted about management conditions, such as "When you have to produce over 5K lines a week, you do stuff like this:"

      --
      Dacels Jewelers can't be trusted.
  12. 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 fizban · · Score: 3, Insightful

      I actually think there's probably plenty of "Fuck Clippy" messages in Microsoft code, and they won't release it because it would show how much they hate themselves.

      The developers in Microsoft can be quite at odds at the organization itself, like in any company...

      --

      +1 Insightful, -1 Troll. What can I say, I'm an Insightful Troll.

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

      Oh, you simply wouldn't believe the inside of MS code bases -- both good and bad.

      The Office Assistant (Clippy and all his ilk) started as a project in the Office group. It came up for review in front of BillG, and when someone told Bill exactly what feature the meeting was about, he said, "Oh, is this about that fucking character?"

      Needless to say, this was a pretty demoralizing remark for the team presenting their new feature. So, internally, "TFC" became the codename for the Office Assistant, and was used as the function prefix, header file prefix, etc. for a long time.

      I know this because I worked with some of the guys from that team, and I've heard the story corroborated by a lot of different sources.

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

      I'd rather see the first. You or course don't sacrifice clarity and actual documentation for humor. But if a comment can both express what it is mean to and be humorous, so much the better.

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

      Not very good at spotting sarcasm, are you?

    5. Re:Well no, it's not all like that by plover · · Score: 3, Interesting
      I beg to differ. Excel '95 had far and away the most elaborate Easter egg I've ever seen. It was a built-in 3D Doom-style temple. You could walk around a la first-person shooter and read the names of the developers on the walls.

      Naming an empty macro "Magic 8-ball" in Word '95 and putting it in the toolbar would give you a magic 8-ball shaped icon that would randomly spew the "Don't bet on it" or "Reply hazy-try later" kind of answers when you clicked on it.

      Easter eggs weren't the exclusive province of the Office development team, either. The first 3D text screen saver under NT 3.51 had a couple of Easter eggs. Typing BEER into the text would bounce around names of beers. Typing VOLCANO would bounce around names of volcanos.

      But once the temple thing was made public in the wild, Microsoft got all suity and made a big stink about it, and they claimed they'd fire anyone responsible for putting any new Easter eggs into any Microsoft product.

      --
      John
    6. Re:Well no, it's not all like that by Reziac · · Score: 2
      I dunno about Windows or Clippy, but... [goes off, greps M$DOS6 source -- filenames omitted to protect the guilty]

      ; fuckin' sixteen-bit machine ought
      ; to be able to handle a SIXTEEN-BIT
      ; DISPLACEMENT!!

      ; is not reliable under DOS versions 4.00 and 4.01. (IBM fuck-up).

      ; BIOS is fucking with us - give up

      ; fucking jump out of range by *two* bytes!

      * path statement. The path can be in about a million fucked up forms
      * depending on the level of stupidity in the user.

      Hmm. That's really not much fuckin' for 60mb of code!! Nope, workin' for M$ won't get you laid enough to notice.

      --
      ~REZ~ #43301. Who'd fake being me anyway?
    7. 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 )

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

    1. Re:FreeBSD's /usr/src/sys/pci/if_rl.c by almeida · · Score: 2

      I have this very card in two boxes, one FreeBSD and the other OpenBSD. I knew the card wasn't fancy, but I figured it was at least halfway decent so I was a bit disappointed when I read your post. The same comment is in /usr/src/sys/dev/ic/rtl81x9.c on OpenBSD. I found this a few paragraphs after what you already posted:

      * It's impossible given this rotten design to really achieve decent
      * performance at 100Mbps, unless you happen to have a 400Mhz PII or
      * some equally overmuscled CPU to drive it.
      *

      Good thing my CPU is sufficiently overmuscled, by their standards at least ;).

    2. Re:FreeBSD's /usr/src/sys/pci/if_rl.c by Door-opening+Fascist · · Score: 3, Informative

      I have this card on a PII-350MHz Red Hat Linux machine, and an integrated one in a 1.3GHz Celeron laptop dual-booting Windoze 2000 and Debian Linux. In Linux, I never get above 5MB/s on a 100baseT-FX link, but in Windoze the limit is around 1.5MB/s. I guess Windoze has even worse support for this chipset than Linux.

    3. Re:FreeBSD's /usr/src/sys/pci/if_rl.c by spongman · · Score: 2

      yeah probably because the windows drivers were written by reltek themselves, and i suppose their software division isn't any better than their hardware...

    4. Re:FreeBSD's /usr/src/sys/pci/if_rl.c by Ilgaz · · Score: 2

      I use Win XP pro now, I had Linux kernel somewhere and when I checked rt8139.c on LINUX kernel, there is a similar thing as that.

      That was the main reason I decided to replace the NIC with another card. Also... YES, its sucky. On windows the "sucky" includes the drivers too.. They don't "release IP" which becomes a huge problem for Cable Internet support services.

      Another "cool" thing about Realtek ;-) They provide Linux driver, check it... Its ZIP format, for gods sake :)

    5. Re:FreeBSD's /usr/src/sys/pci/if_rl.c by Door-opening+Fascist · · Score: 2

      Is the MSI KT4V-L the original nVidia nForce? If it is, I have that too, and am also running Win2k (SP3) on it. I have the onboard NIC running at between 2.5 and 3.5MB/s. Not great, but good enough for my purposes.

      BTW, did you download the unified driver package from nVidia? That's what I have installed, so you might try that. URL is http://download.nvidia.com/Windows/nForce/2.00/nFo rce_win2k_2.00.exe

  15. at my last job by pizza_milkshake · · Score: 3, Interesting

    i was reprimanded for extensive offensive language in my code. how else to keep it interesting?

    1. Re:at my last job by dacarr · · Score: 2
      You were lucky.

      The internal email at my last job had an autoresponder that popped up a window when somebody sent you an email. It was usually filled in with generic comments like "Thanks, I'll get back to you".

      Shortly after the WTC incident, I put 'rm -rf /bin/laden' and was promptly reprimanded for it by my supervisor, who didn't know what it meant. This is the same woman who says telnet "isn't standard" despite RFC 854 being thrown in her face.

      (OK, fine, SSH is preferred.)

      --
      This sig no verb.
  16. 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.
  17. Funny comments from other systems by Anonymous Coward · · Score: 5, Interesting

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

    1. Re:Funny comments from other systems by Anders · · Score: 3, Insightful

      Of course the most famous of all is the comment in the task switching code of the original v6 Unix (Lyons commentary era) which said ... /* You are not expected to understand this */

      And, of course, it means something like "this won't be on the exam". See Odd Comments and Strange Doings in Unix for more of this kind of fun.

    2. Re:Funny comments from other systems by taniwha · · Score: 4, Informative
      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'.

    3. Re:Funny comments from other systems by Guy+Harris · · Score: 2
      panic("Shannon and Bill say this can't happen");

      "Shannon and Dan", as I remember (Bill Shannon and Dan Walsh).

  18. 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 __past__ · · Score: 4, Informative
      Not to mention the unheard cries of thousands of VB code monkeys:

      On Error GoTo Hell

      Or in general

      GoTo ConsideredHarmful

      GNU has a whole page with (more or less) funny variable names

    2. Re:Variable Names too.... by cruachan · · Score: 2

      Your teacher? This one has been around for at least 20 years.

    3. Re:Variable Names too.... by cruachan · · Score: 2

      Oh, should have said, PenIsDown/Up because the joke originally refered to a vector line drawing printer which really did have a pen (or set of pens) on an arm which could be set up/down. Not seen one of those for years now but they sure were cool to watch.

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

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

    6. Re:Variable Names too.... by isorox · · Score: 2

      I like PHP's

      fopen("foo.bar", "r") or die(trying());

    7. Re:Variable Names too.... by __past__ · · Score: 2
      :)

      While we're at it: Didn't the Windows API, back in the days of "cooperative multitasking" include a function "keepWindowsAlive()"? Worked pretty well so far.

    8. Re:Variable Names too.... by iabervon · · Score: 2

      My high school computer teacher found once that he's messed up the capitalization of LoopsEx, which he was showing to the class.

  19. Re:Is all code like this? (I hope so!) by jdkane · · Score: 3, Interesting

    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.

  20. Ok, what's interesting is: by dagg · · Score: 3, Interesting
    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.

    --
    Sex - Find It
  21. 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...

  22. 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)
  23. 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!
    2. Re:Funny printk in die_if_kernel for sparc64 by Xpilot · · Score: 2

      I've seen it more than once each time my Linux-Sparc kernel panics. It does have a sort of soothing effect though, unlike the BSOD :)

      --
      "Backups are for wimps. Real men upload their data to an FTP site and have everyone else mirror it." -- Linus Torvalds
  24. 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.
  25. 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.
  26. 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.

  27. 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.
  28. 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 ;)

    1. Re:some suprises from apps by digitalsushi · · Score: 2

      that looks like jamie zawinkski's work...

      --
      slashdot: where everyone yells sarcastic metaphors to themselves to understand the issue
  29. Not all, but a lot by Syphonius · · Score: 2, Interesting

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

    1. Re:Not all, but a lot by rmohr02 · · Score: 2

      A customer called and complained about that???? Some people have no lives.

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

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

    1. Re:Dutch code! by ewhac · · Score: 2

      /* Do you understand the implication? Do you? */

      *smack hand on forehead*

      I can't believe it took me ten minutes to figure this out. He's caching the result of the strcmp(), which seems like a fairly pointless optimization...

      Schwab

    2. Re:Dutch code! by ChadN · · Score: 2

      Before I go try this out on my really crappy nvidia cards, is the implication that the vendor string can change? So that caching it early on is the only way to know later? That would be crazy... It must mean something else and I'm not getting it. Or is it just a speed thing (assuming this is called fairly often)?

      --
      "It's overkill, of course. But you can never have too much overkill." - Anonymous Slashdot Coward
    3. Re:Dutch code! by ntp · · Score: 3, Insightful

      Not pointless. It's saved in a static variable so glGetString and strcmp are only called once, even if the function is called a million times.

      --
      I control the time!
  32. 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();
    }

    1. Re:after I was laid off ... by Esion+Modnar · · Score: 2, Informative

      This is why many companies walk you out the door the very minute they announce you are laid off. In the middle of that upgrade/install/whatever? TFB!

      --

      They say the first thing to go is your penis. Well, it's either that or your brain. I forget which...
    2. Re:after I was laid off ... by miracle69 · · Score: 2

      forcing you to work without pay is illegal.

      You've never heard of Emtala, have you?

      --
      Linux - Because Mommy taught me to Share.
    3. Re:after I was laid off ... by Sayjack · · Score: 3, Insightful

      Companies which lay people off, then let them code for the remaining 2 weeks are pretty naive. The last thing you want in your system is a pissed off coder.

      I'd rather have a hacker in my system than an angry coder any day. They should get a clue.

      --

      -- Good judgement comes with experience. -- Experience comes with bad judgement.

    4. Re:after I was laid off ... by Fulcrum+of+Evil · · Score: 2

      I can beat that. One place fired me, then demanded I work for them during my severance period.

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
    5. Re:after I was laid off ... by isorox · · Score: 2

      I take it you demanded they pay you

      What is it with people that are willing to be screwed over for free?

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

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

  35. Especially in code that uses MFC by Mr.+Sketch · · Score: 2

    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.

  36. redefines the meaning of 'low end.' by kfg · · Score: 4, Interesting

    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

    1. Re:redefines the meaning of 'low end.' by silvaran · · Score: 2

      Did you ever get your chocolate bar?

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

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

    3. Re:redefines the meaning of 'low end.' by glitchvern · · Score: 2, Informative
      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.


      Another good place is in section 4 man pages. The bsd's actually have man pages for most of their drivers. Here are FreeBSD's ethernet drivers, OpenBSD's ethernet drivers, and NetBSD's list of all drivers (NetBSD's web page doesn't provide a link to just their ethernet drivers. Also check out the quick reference catagories on FreeBSD's and OpenBSD's online man pages for other device drivers.
    4. Re:redefines the meaning of 'low end.' by alexburke · · Score: 2

      I work at a computer store, and we sell a model RC-8139C (God only knows who assembles them) with, amazingly enough, an 8139 as its main IC.

      Our cost from our distributor is something like C$7 each (purdy little cardboard box included), and we sell them for C$11.

      The next step up is the DFE-528, at about C$25 retail.

      After that, it's the 3C905TX-M (with the newer BGA IC), at something like C$58 retail. We had three in stock in August '02, and we had three in stock -- the same three -- today.

      All of that probably has something to do with why the 8139 is nearly everywhere you look...

  37. Strangely enough ... by Aceticon · · Score: 4, Interesting

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

  38. Some true gems by jongus · · Score: 2, Informative
    I found this while browsing E2.

    Just just gotta love this one:
    include/asm-mips/mmu_context.h: /* Fuck. The f-word is here so you can grep for it :-) */

  39. Some of mine... by BoneFlower · · Score: 2

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

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

  41. 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
    1. Re:from code I used to work on by rmohr02 · · Score: 2
      Weighted shuffling for Winamp. Download RoboDJ [robodj.org] now.
      Cool. What version of WinAmp? I use 2.8 because I have to use a 2.x version to get the WinAmp Trillian plugin to work.
    2. Re:from code I used to work on by rmohr02 · · Score: 2
      Well, I'll assume it works for 2.x because of this:
      An experimental Winamp 3 version of this plugin exists.
    3. Re:from code I used to work on by ucblockhead · · Score: 2

      Right now, 2.x, but I am releasing a version that supports both 2.x and 3.x this week sometime.

      --
      The cake is a pie
    4. Re:from code I used to work on by rmohr02 · · Score: 2

      Cool program. I'd been wanting something like it, but I'd never spent much time looking.

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

  43. Funny Code by afabbro · · Score: 2

    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
  44. A few snippets... by La+Temperanza · · Score: 2, Interesting

    linux/arch/mips/kernel/sysirix.c:

    /* 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) {
    /* Time to push up daises... */
    if (del_timer(&h->ctrack->timeout))
    death_by_timeout((unsigned long)h->ctrack);
    /* ... else the timer will get him soon. */
    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 :-( All the routers (except for Linux) return only
    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
  45. The purpose of comments is to be USEFUL... by dpbsmith · · Score: 2

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

    1. Re:The purpose of comments is to be USEFUL... by gilroy · · Score: 3, Insightful
      No. A purpose of comments is to be useful. As the bazillion examples posted here show, there are apparently other uses for comments, such as to let off steam, amuse oneself (or one's peers), or just be clever.


      Unless the spurious commenting actively obstructs maintenance -- and it's hard to imagine how it could do that -- it's perfectly fine if it's funny, witty, or (gasp!) off-task. Work is done better by those who enjoy themselves doing it.

    2. Re:The purpose of comments is to be USEFUL... by Elwood+P+Dowd · · Score: 3, Interesting

      Work is done better by those who enjoy themselves doing it.

      This is a common misconception. Unhappy, overly criticized workers are less likely to make mistakes, and get more accomplished. In the general case. Extensive research on the subject has been published, although I'm not interested in hunting it down.

      --

      There are no trails. There are no trees out here.
    3. Re:The purpose of comments is to be USEFUL... by Elwood+P+Dowd · · Score: 2

      Well, I'm pretty sure that the studies were with officeworkers in general. So it's still possible that more creative jobs require more relative happiness. Of course, I don't think you can call us VB programmers creative professionals, exactly.

      --

      There are no trails. There are no trees out here.
    4. Re:The purpose of comments is to be USEFUL... by refactored · · Score: 2

      /* "If you feel the urge to document you should simplify the code until
      the code is so lucid that the urge to document goes away." -
      John Carter

      "Bugger" - Matt D

      Umm. This code was kind of twisted.

      So I'm going to untwist a little.

      But only a little.

      It is not really evil. Just a little mindwarping.

      You see there is this cute Reactor singleton that dispenses wisdom,
      mothers milk, signals, events i/o etc. etc.

      Well. Umm, I fork() and exec it three times.

      So the singleton actually becomes a quadrupleton.

      But only one per process. Got that?

      So we keep the original process around to watchdog the other 3.

      So Reactor singleton #1 is watching the other three.

      It responds to SIGCHLD's and restarts the other three when they die.

      It responds to SIGINT's and kills off the other three when it is
      time to finish.

      It has a neat little timer that checks that the other three have put
      a fresh timestamp in their little timestamp slots.

      If they haven't it concludes they have gone barkin' mad and takes
      them out back and shoots them.

      Now to kill off the kiddies it sends them a SIGILL, to which they
      should respond by quietly shutting down and exiting.

      If they don't they get clobbered with a SIGKILL.
      */

    5. Re:The purpose of comments is to be USEFUL... by Cro+Magnon · · Score: 2
      Unhappy, overly criticized workers are less likely to make mistakes, and get more accomplished.

      True. The unhappy workers screw up their code on purpose.
      --
      Slow down, cowboy! It has been 4 hours since you last posted. You must wait another few hours.
  46. 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 */

  47. Hilarious by Rogerborg · · Score: 2

    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.
  48. Re: malloc by Fweeky · · Score: 2
    Furthermore, as a small hint... on freebsd, it was always good to make a file called malloc.conf in the /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...

    Actually, malloc.conf is supposed to be a symlink to a file*name* containing options, not a regular file containing them, i.e:
    ln -s 'H' /etc/malloc.conf
    man malloc for more flags, and alternative ways to specify them.
  49. Half-Life SDK comments by sheetsda · · Score: 5, Funny

    See here and my sig.

  50. printer error "on fire" now gone. by cant_get_a_good_nick · · Score: 2, Informative

    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.

    1. Re:printer error "on fire" now gone. by bluGill · · Score: 2

      While printers MIGHT have caught fire at times, it did not happen often. I've seen many jamed dot-matrix printers (funny how tractor feeds seemed to jam all the time, but plain paper which seems harder rarely jams), but none that even got hot enough to smoke.

      The real reason for that comment was the Centronic parrel port had an error line for out of paper, an online status line, and another error line. The comment in the code read something like /* Not out of paper and not offline. Must be on fire */. Most of those ports were not bi-directional back then without some fancy tricks that printers didn't support, so all problems other than out of paper and offline had to all be lumped into one error.

  51. Re:Assembly Comment by FyRE666 · · Score: 2

    Thus we renamed all of the jump entries in the jump tables (remember those?)

    Yeah, I've always considered them to be "switch blocks for *real* programmers".

  52. Printer On Fire! by chill · · Score: 2

    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.
  53. We need more comments like this! by coyote-san · · Score: 5, Interesting

    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
    1. Re:We need more comments like this! by danamania · · Score: 2

      I've done a couple myself, especially when learning a new language, playing with different constructs provided, and finding those little unique 'features' that I don't yet understand.

      If I can't differentiate between luckily stepping into a solution without understand it fully, and coming across something that the language SHOULDN'T do, I'll comment it as such. Not usually quite as concisely however :).

      a grrl & her server

    2. Re:We need more comments like this! by packeteer · · Score: 2

      I tend to do this is basic stages of programming. A lot of times coders have taught me to put in logic that should never be reached

      Its as simple as:
      if(something) { //sweet it worked
      }
      else { //wtf?
      }

      --
      unzip; strip; touch; finger; mount; fsck; more; yes; unmount; sleep
  54. 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. =)

  55. Horse & Pig reference in Kernel 2.4.20 by antdude · · Score: 2

    [...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).
    1. Re:Horse & Pig reference in Kernel 2.4.20 by antdude · · Score: 2

      [linux-2.4.20]$ grep -r "[Aa][Nn][Tt]" *

      gave me too many hits. None of the results show ant word by itself. :(

      --
      Ant(Dude) @ Quality Foraged Links (AQFL.net) & The Ant Farm (antfarm.ma.cx / antfarm.home.dhs.org).
    2. Re:Horse & Pig reference in Kernel 2.4.20 by antdude · · Score: 2

      Thanks and it worked. I didn't see the spaces due to the bad tiny fonts in Mozilla. :)

      --
      Ant(Dude) @ Quality Foraged Links (AQFL.net) & The Ant Farm (antfarm.ma.cx / antfarm.home.dhs.org).
    3. Re:Horse & Pig reference in Kernel 2.4.20 by kasperd · · Score: 3, Informative

      Does anyone know how to do grep for "ant" (exact word by itself)? :)

      Lots of answers, but most of them not really good. How about reading the man page. After doing that, I came up with this:
      grep -ir "\<ant\>" *

      The use of -i is simpler than specifying every letter could be upper or lower case. And the use of spaces at each end of the word misses those cases where where other chars are used at the word boundaries. Then better use the grep builtin feature to indicate start and end of a word.

      --

      Do you care about the security of your wireless mouse?
    4. Re:Horse & Pig reference in Kernel 2.4.20 by cant_get_a_good_nick · · Score: 2

      grep '\<[Aa][Nn][Tt]\>' ....

      The \< and \> metacharacters anchor it to the beginning or end of a word. I'm not sure if it's in all grep's, but GNU grep (the one on Linux and Cygwin, and some others) support this. Check your man page.

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

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

  58. Older post of this by autocracy · · Score: 2, Informative

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

    1. Re:Grepping the kernel source code for 'fuck'. by cant_get_a_good_nick · · Score: 2

      I remember a story a while back stating that all the 'fuck's in the Linux source code could possibly get it censored. I think at the time Australia had rules strict enough to technically make downloading the Linux kernel illegal.

  60. Re:Recursive search? by orangesquid · · Score: 2

    IMHO..

    I don't see how this is abuse. Algorithmic recursion is a subset of general "recursion" as the dictionary defines it. Algorithmic recursion is where the entire algorithm simply repeats, repeats, and repeats, (each repitition functions on a different subset of some data; otherwise this would just be redundant) to finish a task. This is different from iteration, which is a *piece of * the algorithm.

    algorithm Bob: {data}
    [ Recursive ]
    step 1: do something;
    step 2: do something;
    step 3: do something with Bob(subset of data).

    The evaluation of this algorithm causes the recursion.

    algorithm Bob: {data}
    [ Iterative ]
    step 1: iterate {(substep 1: something * substep 2: something)(subset i of data)} with i from point1 to point2

    The evaluation of this algorithm causes the substeps to recurse, but the algorithm does not recurse. This distinction is what makes the second version of the algorithm simply "iterative," even though it has inner recursion.

    Besides, as we all know, the dictionaries are a function of time, social mentality, and the spoken word; words and definitions are forever coming and going from it.

    --
    --TheOrangeSquid Is it any wonder things seem so awry? We swim in a sea of confusion and don't have to think to survive
  61. 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.
  62. personal experience by morgajel · · Score: 2

    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.
  63. My favorite C variable name by JWhitlock · · Score: 3, Funny

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

  64. Burning Printers by Alien54 · · Score: 3, Informative
    The full story on Burning Printers can be seen 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"
  65. ASCII Art comments by Drakonian · · Score: 3, Interesting
    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. It can use many different "fonts". Great utility.

    --
    Random is the New Order.
  66. Re:We paid a guy to sanitize our code by EvanED · · Score: 2

    Hell... i'll do that. Just give me the code and a program with a search and replace feature and I'll have it alll fixed up.

  67. The Better the Code the More Colorful the Comments by Greyfox · · Score: 2
    I've noticed that better programmers tend to include more colorful comments. 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. Of course, somewhere along the curve they just don't comment at all.

    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?

  68. For dummies... by dacarr · · Score: 2

    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.
  69. 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?";
    }

  70. Error 1109: There is no message for this error. by Simon+Brooke · · Score: 2
    My favourite error message of all time is a Microsoft Access one, which is quoted in the subject. I can think of nothing more perfect or complete.

    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() + "'";

    // Baroque, innit? Why, you say, did
    // he not use Calendar.getTimeInMillis()? Well,
    // cos it ain't there, no matter what the friggin docs say.

    . . .

    catch ( ParseException p)
    {

    // I really, really would prefer
    // this didn't happen

    . . .

    if ( offset == 0)

    result.append( "Z");
    // zero offset -- excellent, easy.
    else
    {
    // horrible, horrible, oh most horrible.

    . . .

    /** A simple specialisation of a GregorianCalendar which doesn't make
    * 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.
  71. 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
  72. Re: malloc by joto · · Score: 2
    Actually, malloc.conf is supposed to be a symlink to a file*name* containing options, not a regular file containing them,

    Wow, that's just scary! It's not that it wouldn't work, but it just scares me to think of what kind of other weird stuff the man who thought of that would put into code elsewhere...

    Not that I don't see similar stuff daily :-)

  73. Tac, tac, tac... by CaptainZapp · · Score: 2
    device is bolixed

    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

  74. Coincidence! by wackybrit · · Score: 2

    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.

  75. Re: malloc by Fweeky · · Score: 2

    Actually it struck me as being quite logical, especially for such an important syscall. It means you can get the options with a single pretty much atomic and very cheap call to lstat() -- otherwise you'd need at least an open()/read()/close(), and then you run into worrying about locking while the config file's open.

    It did make me do a bit of a double-take when I first saw it though :)

  76. Mod up, right answer! by seanadams.com · · Score: 2

    "static" is way underrated.

  77. Umm maybe not... by rufusdufus · · Score: 2

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

  78. I think every Real Programmer does it. by Montreal+Geek · · Score: 2
    Sometimes, as reminders, sometimes as self critique.

    Indeed, one of my current pet open source project has a comment that reads:

    // WARNING: This code is ugly as hell, contains black magic, and is // probably going to be a nightmare to fiddle with. It's also suspected // to contain at least one buffer overflow, and to contribute to // holes in the ozone layer. // I wish I wish I wish I could get rid of it.

    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

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

  80. Re:bad bad devs by Anonvmous+Coward · · Score: 2

    "bad bad devs (Score:1, Redundant)
    Just grep the kernel sources for bad words, you'll be suprised (and amused ;) )."


    Looks like you shoulda grepped before you posted. ;)

  81. Mainframe humor: BDOLVB by cant_get_a_good_nick · · Score: 4, Interesting

    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.

  82. RE: OT -- grep... by antdude · · Score: 2

    That doesn't work well because I get too many hits like:

    drivers/gsc/.depend: /home/ant/kernels/linux-2.4.20/include/linux/types .h \
    drivers/gsc/.depend: /home/ant/kernels/linux-2.4.20/include/asm/io.h \
    drivers/gsc/.depend: /home/ant/kernels/linux-2.4.20/include/asm/irq.h \

    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).
  83. Re:The Better the Code the More Colorful the Comme by |_uke · · Score: 2

    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
  84. Re:We paid a guy to sanitize our code by forkboy · · Score: 2

    Several days? Doesn't this guy know how to fucking use grep? Jesus. Let me guess, he was paid by the hour...

    --
    This message brought to you by the Council of People Who Are Sick of Seeing More People.
  85. Re:Actual comment I have seen by jericho4.0 · · Score: 2
    Ah, ya gotta love those newbies.

    Seriously, I would rather see every line commented in pseudocode than no comments at all. Literate programming is a nice model to work with.

    --
    "A language that doesn't affect the way you think about programming, is not worth knowing" - Alan Perlis
  86. Mozilla and clearing history by Pinky · · Score: 3, Informative

    I was trying to find out how to clear the history from XUL in mozilla when suddenly ->

    The comment above the code for clearing the history in mozilla is something like /**** No honey, I haven't been visiting any porn sites. ****/

    Mozilla has lots of stuff like that.

    I mean this is how you import the standard library ->

    xmlns="http://www.mozilla.org/keymaster/gatekeep er /there.is.only.xul"

  87. 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
  88. lib/vsprintf.c.... by Kymermosst · · Score: 2

    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.
  89. Dennis Ritchie's ancient 1973 c compiler by Billly+Gates · · Score: 2
    // This is to waste memory

    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.

  90. Another one... by OrangeHairMan · · Score: 2

    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

  91. Linus started it... by option8 · · Score: 2

    humorous bits of code and comments from linus torvalds' 1991 kernel (version 0.01):

    Entertaining Bits from the Ancient Kernel Tree

    1. Re:Linus started it... by option8 · · Score: 2

      i need to update that page. i posted it a couple years ago when the company i work for was working on the first redhat annual report - which folds out into a poster with the word "open" across the front. there were some ideas thrown out for what to put on the back of the poster; at the beginning it was just going to be blank to save money, IIRC.

      being the "web guy" and the only person at our mac-based graphic design company to actually have used linux (it was around that time that i replaced our old mac file server with a linux box, guaranteeing my job security) i threw out the idea of putting the kernel source on the back.

      well, needless to say, the people we were working with at redhat loved it (and loved it more after talking to some programmers). so i popped over to kernel.org and popped the concatenated text over to the designer working on the poster. the current source being about 4,000% larger than the original at that time (2.2something), we stuck with the original :)

      redhat's legal folks wanted to be sure the source was safe to use and print, since v.01 wasn't covered by GPL. i noted the copyright that said the code was free for use so long as it contained that text. the writer for the report traded emails with alan cox on the subject.

      then they wanted me to go through the text and take out the comments.

      WTF?

      oh no! it has bad words in it! they didn't seem to think there would be anything decipherable in the code, i think. in particular, someone had stumbled on linus' comment about leap years in mktime.c "I also hate Gregorius, pope or no. I'm grumpy." and thought there might be problems with its anti-pope nature.

      that and "Wirzenius wrote this portably, Torvalds fucked it up :-)" in vsprintf.c

      in the end, cooler minds (i.e. mine :) prevailed, and we didn't even have to replace fuck with f**k, which was a proposed compromise at one point.

      anyhoo, it ended up a cool poster, and i still have a copy hanging in my office at home. from our subsequent work for redhat, i hear that a number of the programmers have copies up in their cubes, too.

  92. You are correct by msobkow · · Score: 2

    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.
    1. Re:You are correct by Elwood+P+Dowd · · Score: 2

      Oh, me too. I'm not saying that this makes unhappiness desireable for workers. In many situations, specific kinds of worker unhappiness can be profitable for the company.

      This isn't a moral judgment. It's just the way people work.

      --

      There are no trails. There are no trees out here.
  93. Theoretically shouldn't happen! by fo0bar · · Score: 2

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

  94. 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
    1. Re:Colorful Input by MeerCat · · Score: 2

      suggested "Last name 'Hunt' , First name 'Mike'".

      A friend of mine from school also used to suggest Mike's brother - Yorrick.

      --
      I spent a lot of money on booze, birds and fast cars. The rest I just squandered. - George Best
  95. 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

  96. I'm not pagan, just the hardware by bluGill · · Score: 2

    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.

  97. Did "EIEIO" damage Intel ? by Taco+Cowboy · · Score: 2



    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 !
    1. Re:Did "EIEIO" damage Intel ? by GlassHeart · · Score: 2
      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.

      This is an example of the right joke on the right audience, which is why I said these things could damage reputation.

      If I see expletives in source code, however, I cannot help but conclude that the company in question does not practice effective code review. Code review, as you must know, is one of the most cost effective ways to catch bugs, and they're not doing it.

      Jokes are even worse. Most jokes are at least a little offensive to somebody, so there is really a time and place for these. Putting it in source code means that the joke may be read a long time in the future by somebody from a very different culture.

      Remember that it's really hard to be actually funny. Successful comedians get paid a lot of money, and for some reason your day job is still programming.

  98. how not to comment your code by MegaFur · · Score: 2

    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.
  99. Re:On the fifth day of Xmas my Torvalds gave to me by jo42 · · Score: 2

    ...and the 31,416th version of the kernel, which required the latest glib, which broke all my apps...