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

20 of 485 comments (clear)

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

    Linked off of article here.

    Easier to read too.

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

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

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

  6. 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 :-) */

  7. 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...
  8. Re:Is all code like this? by Anonymous Coward · · Score: 1, Informative
  9. 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.

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

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

  13. 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"
  14. Re:Your VB monkeys are good then... by Anonymous Coward · · Score: 1, Informative

    Yep, that's valid VB to pretend the error didn't happen and carry on to the next instruction. It's at the top of just every .vbs virus/worm I've ever seen (where spreading at all costs is the goal regardless of things breaking) but it certainly has no place in "real world" code.

    Of course you could argue the real culprits are MS for putting this in the language to start with. At least such a horrible kludge is slightly more work in other languages, e.g.

    catch (Exception e)
    {
    return;
    }

    Bonzo the wonder dog

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

  17. 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?
  18. 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.
  19. 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?
  20. 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"