Slashdot Mirror


Entertaining Bits From The Ancient Kernel Tree

option8 writes "I have added a page of some of the miscellaneous comments that appear in the Linux Kernel, version 0.01 (ca. August, 1991). Linus turns out to be quite the jokester, leaving all kinds of non-sequiturs and irreverent one-liners in the code, many of which survive today in the latest developmental releases. I thought to archive these and share with those people who aren't the types who go diving through ten year (gasp!) old code for kicks. Enjoy."

63 of 171 comments (clear)

  1. Pope hating by jidar · · Score: 3

    /*
    * PS. I hate whoever though up the year 1970 - couldn't they have gotten
    * a leap-year instead? I also hate Gregorius, pope or no. I'm grumpy.
    */

    This cracks me up. He even hates the Pope, :)

    seriously, this is probably going to end up in some news article some day;

    This just in...
    "Linux created by Pope hater! OS of Satan!"

    Of coarse I guess we would have to fight with Microsoft for the "OS of Satan" title...

    --
    Sigs are awesome huh?
  2. Colorful Comments by artdodge · · Score: 3
    DaveM is notorious for his comments in the TCP/IP stack. Look especially through the 1.3.X and 2.1.X patches for some tasty examples. "Fscking Sun blows goats" has shown up a few times, if I remember correctly.

    You can also search the linux-kernel mailing list archives for some lively debates about "cleaning up the language in the kernel source"...

    1. Re:Colorful Comments by Zurion · · Score: 2
      Just an FYI for those interested in the "colorful" comments in the linux source (2.2.14..yeah, yeah, I'm not up to date):

      # grep " shit " --recursive * 2>/dev/null
      arch/sparc/mm/srmmu.c: * else we eat shit later big time.
      arch/mips/kernel/sysirix.c:/* 2,526 lines of complete and utter shit coming up... */
      drivers/net/sunhme.c: /* Remember: "Different name, same old buggy as shit hardware." */
      drivers/scsi/esp.c: /* shit */
      drivers/scsi/esp.c: /* shit */
      drivers/scsi/esp.h: /* The HME is the biggest piece of shit I have ever seen. */
      drivers/scsi/NCR53C9x.c: /* shit */
      drivers/scsi/NCR53C9x.c: /* shit */
      drivers/scsi/NCR53C9x.h: /* The HME is the biggest piece of shit I have ever seen. */

      # grep " fuck" --recursive * 2>/dev/null
      arch/i386/kernel/mtrr.c:/* Some BIOS's are fucked and don't set all MTRRs the same! */
      arch/sparc/kernel/process.c: /* fuck me plenty */
      arch/sparc/kernel/sunos_ioctl.c: /* Binary compatibility is good American knowhow fuckin' up. */
      arch/mips/kernel/irixelf.c:#if 0 /* XXX No fucking way dude... */
      arch/mips/kernel/irixioctl.c: * irixioctl.c: A fucking mess...
      arch/mips/sgi/kernel/setup.c: * fucking with the memory controller because it needs to know the
      arch/sparc64/kernel/process.c: /* fuck me plenty */
      drivers/net/sunhme.c:/* Only Sun can take such nice parts and fuck up the programming interface
      drivers/block/cmd640.c: * These chips are basically fucked by design, and getting this driver
      drivers/scsi/esp.c: * how bad the target and/or ESP fucks things up.
      drivers/scsi/esp.c: * phase things. We don't want to fuck directly with
      drivers/scsi/esp.c: /* Be careful, we could really get fucked during synchronous
      drivers/scsi/qlogicpti.h:/* Am I fucking pedantic or what? */
      drivers/scsi/NCR53C9x.c: * how bad the target and/or ESP fucks things up.
      drivers/scsi/NCR53C9x.c: * phase things. We don't want to fuck directly with
      drivers/scsi/NCR53C9x.c: /* Be careful, we could really get fucked during synchronous
      drivers/cdrom/sbpcd.c: CURRENT=req->next; /* task can fuck it up GTL */
      drivers/video/tgafb.c: /* XXX Why the fuck is it called modename if it identifies the board? */
      include/asm-sparc64/system.h: /* If you fuck with this, update ret_from_syscall code too. */ \
      lib/vsprintf.c: * Wirzenius wrote this portably, Torvalds fucked it up :-)

      I think this is kinda cool, and it shows the real people behind a very useful and neat piece of software. And who can't resist putting something like GetHead() in code for a linked list. I did that a couple of times in college assignments, and the professors never said anything.

  3. Re:Wrote this one just yesterday by Squid · · Score: 2

    My last job I had to maintain someone else's downright weird Perl - not ordinary obfuscated Perl, mind you, this was Perl written by someone who obviously grew up in Visual Basic. His comments were few and far between, and when he DID comment, it was not much more understandable than the code it accompanied.

    At one point I left a comment something like this:

    # Todd, please don't comment if the code is clearer without it.

    Too bad he'll never see it. :-)

  4. Re:Post your own comments by Squid · · Score: 2

    Slightly amusing comments I've found in my own code:

    # They painted the office today and the fumes are getting to
    # me. Don't be surprised at anything you find in the code
    # from here down.

    In code claiming to be a "complete rewrite" from the previous version:
    # This section stolen from the previous version

    # I have a feeling this is very wrong.

    # This code would require about eight seconds to optimize, I just haven't
    # done it yet.
    (I've had plenty of chances in the last 2 years to optimize that code.)

    # No. I refuse to document this.

    # This actually subverts some optimizations later on, but maybe it'll add up okay
    # in the end.

    if ($notready)
    {
    # Kosh: "You are not ready for immortality."
    ...

    # Done parsing silliness.

    # Let's be even bruter with the brute force.

    # Stupid design? Well, that or read the main list twice.

    # Yowza.

    # It's a dumb idea. I will fix it. When I figure out how.

    # That's poorly named.

    In code that was later commented out:
    # is this smart or stupid?
    I must have decided later it wasn't smart...

    # Now to run through the loop again. I smell an optimization coming.

    # Augh! A reference!

    # Let's just use the 32-bit numbers. To hell with Y2K bugs, let's go to S2B - the
    # 2 billion second bug.

    # There's only one universe, so no args (yet)...

    # Got 'im.

    # Just pretend for the moment it works.

    # Nasty mean vicious nested foreach

    # Whew! Several trips through the datafile later...

    # This next part makes me wish I'd commented it the first time.
    (Followed by uncommented code, apparently written in a hurry.)

    # silliness!

    # Let's GET IT ON!

    # cheap-ass code to calculate days between two dates

    Some code that did weird (and probably unnecessary) date calculations contained these cryptic comments:
    # now has a Y1K9 bug and thus cannot be used in years before 1900.
    # It also now has a year 11734883 bug - that's when (yr*366) > 2^32.

    In some particularly weird code we converted to Y2K ready in 1997:
    # If you need this to work past 2100, come thaw me out.

  5. Re:Post your own comments by Kronovohr · · Score: 2

    ; What the fuck! This was a typo,
    ; but if I change it to the correct
    ; syntax it breaks!

    /* Supposed to be an infinite loop. Dies in 65536 cycles under DOS. */

    /* If this doesn't work, I'm shooting someone. */

    /* Uncomment this line to make it mangle the filesystem */

    /* fork() you! */

    /* Just when I thought it couldn't get any worse... here's: */

    /* Why, oh why, does this have to be in here? */

  6. What else do you all put into your code? by Tony+Shepps · · Score: 2
    What else do you all put into your code? My comments tend to be apologies more than anything else:

    // This is brute force, but I didn't have time
    // to do it right. Sorry. Someone else fix.

    // I'm not checking the return value because
    // I'm lazy, not because it doesn't need checked

    Or sometimes I just get wacky:

    // I got two turntables and a microphone

    The other approach is creative "self-documenting code":

    $ridiculous_index =

    ...and of course the inevitable, incorrect:

    while ($LoopUntilWeDie)

    --

    1. Re:What else do you all put into your code? by llywrch · · Score: 2

      Heh. One of my favorite comments comes from the Lynx source:

      /*
      * here's where we do all the work
      * mainloop is basically just a big switch dependent on the users input
      * I have tried to offload most of the work done here to procedures to
      * make it more modular, but this procedure still does alot of variable
      * manipulation. This need some work to make it neater.
      */

      Lou Montoulli wrote that back in 1994 -- if not earlier. It explains -- in 25 words or less how every browser works. It has been in LYmain.c ever since. And prolly in the source code to both Netscape & IE (well, next to ``Netscape coders are weenies.")

      Food for thought, huh?

      (And I'm ignoring the chance to comment on how he ended up marrying the bosses daughter.)

      Geoff

      --
      I think I see a trend here. Maybe for them it really would be easier to muzzle the entire internet than to produce p
    2. Re:What else do you all put into your code? by Nagash · · Score: 5

      I put this in an assignment for an Artificial Intelligence course. It was a Java applet that implemented the A-star search algorithm that we had to modify. The code was pure garbage, and the teaching assistant that marked it was also the one who picked it off the web in order for us to modify it. I was not amused. So, I stated my position in a rather forward manner...


      // what the hell is with this magic number crap?
      // /me slaps original programmer around with a hammer.

      ...

      // This is a butt ugly hack, but given the utterly shit
      // code that surrounds it, it should feel right at home.

      ...

      // I don't know why I had to set a number to tell me what
      // finishCell to use, but I did. I simply do not have the
      // time to wade my way through this crap program to figure it
      // out. I got better things to do, like pull my fingernails
      // out and then bathe my hand in lye.

      ...

      // I added this awful, awful hack. I am ashamed to have written code like this.


      I also wrote a letter to the prof and TA on behalf of the other multitudes of students who thought the same thing I did. Needless to say, I got a bad mark (didn't care anyway) and the TA hates me now. Turns out they really do read the comments! =)

      Woz

  7. Re:As far as finding the Rainbow series online.... by jpatokal · · Score: 3
    "Department Of Defense Trusted Computer System Evaluation Criteria" ("Orange Book"), 12/85 I knew the Orange book was online... if I ever find the others I'll let you know.

    There are many Color X Books out there, the original poster was referring to the particular Orange Book that defines (one of) the standards for CD(-ROM?) encoding.

    Cheers,

    -j.

  8. OS of Satan by Kryptonomic · · Score: 2
    Of coarse I guess we would have to fight with Microsoft for the "OS of Satan" title...

    It depends on whether the "OS of Satan" refers to the OS on which Satan is able to run his database system of lost souls in the most efficient manner, or if it refers to an OS which is an instrument of torture in the Hell.

  9. Re:I don't know... by anonymous+cowerd · · Score: 2

    In a film can in my desk I've got a thirty year old one that's on punched paper teletype tape. Feed it into the tape reader and it prints out a full-length standing nude at about 0.7 scale that you can hang on the wall.

    Yours WD "old old old" K - WKiernan@concentric.net

  10. I see you by anonymous+cowerd · · Score: 2

    There you go again. I know what you're up to.

    Your fan WDK - WKiernan@concentric.net

    ps: send me to Europe!

  11. Slightly offtopic but... by seizer · · Score: 5

    Did anyone see that someone posted the incomplete source to COMMAND.COM way back?

    http://slashdot.org/co mments.pl?sid=00/06/08/0647212&cid=574.

    Have to love this bit:

    ; REV 1.50
    ; Some code for new 2.0 DOS, sort of HACKey. Not enough time to
    ; do it right.


    --Remove SPAM from my address to mail me

    1. Re:Slightly offtopic but... by Vanders · · Score: 2

      Heh, how about:

      ; Speed not high priority here.

      Seems so...fitting, in an M$ product ;)

  12. not flame, no never never flame by anonymous+cowerd · · Score: 2

    No, it will not "get you burned at the stake." We care to much about our brethren to do such a cruel thing to them. No matter how foul their sins, no matter how widely they offend us. Even if they go so far as to spit upon the holy primary source code, we love them too much, though they are sore misguided, to be so merciless.

    We do not shrink from physical torture. For indeed, it is the curse of mortality and the payment for our forefathers's sins that we shall endure pain all our days - cf. configuring X the first time on a new computer. But pain does not endure, nothing that is based in the flesh endures, for flesh is dust. Before and above all other issues one has to consider the fate of the immortal soul.

    Would we burn an unrepentant, inconverted heretic? Would we commit him to an eternity in the blue screen of Hell? No.

    No, first we will bring him back into a state of blessedness, which he can attain by simply admitting and repenting his errors, his blindness, his hamartia. We start by gently counseling our prisoner. If, as sometimes happens, verbal persuasion doesn't work, then at our command are the various goads of isolation, starvation, exposure, sleep deprivation, restraint, heat or cold therapy, infusion with hypnotic or hallucinogenic narcotics, electroshock; then if these fail, though they seldom do except for the most obdurate sinners, we (for as I said before, we to not shrink from torture) apply the harsh but necessary techniques of
    **********************************************
    **********************************************
    **********************************************
    **********************************************
    *********************************************.

    Eventually even the most stubborn of our heretics comes around, sees and admits his fatal error and repents. And as Linus is endlessly forgiving, thus the Holy Penguin again accepts our brother, once a heretic but now one no more, back into his loving and eternal embrace.

    Only then do we burn him.

    Yours Fr. WDK - WKiernan@concentric.net

  13. Comments in VB by porlw · · Score: 2

    I used to work for a company that had a product
    developed in VB. Having a small (around 200)
    client base, the developers knew the customers pretty well.

    Quite often comments in the source code mentioned
    a specific customer. They could get quite disparaging, e.g.

    REM Hack the tab order YET AGAIN for customer X.
    REM They really don't seem to have a clue.

    One day a customer complained. Apparently early
    versions of VB actually COMPILED THE COMMENTS INTO THE BINARY. How lame is that? Someone had to go through and clean up the source. With so few customers we couldn't afford to upset them too much!

  14. Sort of eerie by Red+Moose · · Score: 5
    It's a bit eerie reading that (c) 1991 Linus Torvalds, almost a decade ago.

    Think about, Win32 didn't exist, and IBM didn't know MS were going to screw them over with OS/2. Amiga were fighting with Atari.

    The Gulf War was on...threats of bombing and the stealth plane made it's debut.

    Slashdot didn't exist. Heck, Tim Lee was thinking maybe Hypertext mught be a cool way to store his university notes, thus was born the web.

    Usenet didn't contain thousands of porn pictures, BBS systems were alive and well.

    Sort of wierd, that unknown to all the mainstream and even tech groups Linus + some people were working on the only OS that would ever threaten Microsoft.....that Microsoft would even *need* threatening.

    And still 10 years later, MacOS still is cludgy and can't multitask....I suppose some things just don't change.

    --

    Acting stupid isn't much fun when there's someone around who knows better

  15. That's a classic by bandicoot · · Score: 3

    "For those with more memory than 8 Mb - tough luck. I've not got it, why should you."
    -- Linus Torvalds, 1991

    "Nobody will ever need more than 640k RAM!"
    -- Bill Gates, 1981

    So who's the bigger idiot?

  16. POSIX wanted money for a *standard* by Black+Perl · · Score: 3
    From Linus' comments:

    * Hopefully these are posix or something. I wouldn't know (and posix
    * isn't telling me - they want $$$ for their f***ing standard).

    POSIX wanted money for a standard. That's fascinating. How did they think a standard was going to catch on if they charged people to just *see* it?

    I guess it's a telltale sign of the mindset of the Unix community in the early 90's. Charge an arm and a leg for everything. Some of the stragglers are still just breaking free of that mindset (Motif comes to mind).

    --
    bp
    1. Re:POSIX wanted money for a *standard* by mindstrm · · Score: 2

      Uhh.. that's how MOST ansi standards work.

      802.3? Pay up. 802.11? pay up.

      rs232? pay up. v.32bis, pay up....
      You don't have to pay to use them necessarily, but you may not reproduce the standards documents, and they cost $$$$$

    2. Re:POSIX wanted money for a *standard* by Pieter-Bas · · Score: 4
      Most standards are confidential. Licenses are being sold. Many of them have no problem catching on at all. Examples:

      • CD (Orange, Green, Red book) are all still secret. You can not find them on internet
      • DVD + Next.Gen. DVD (Confidential standards. Kept a (trade) secret by the DVD Forum!)
      • Dolby AC3 Digital Audio [And with it all Dolby sandards]
      • ISO9660 (for some time, it's ECMA119 now and downloadable for free, but ISO charge[sd] about $1000 for it)
      • MacroVision (though I don't think it would have caught on in the Open Source world :) )
      • FAT32 and NTFS (eeeh... well...)
      By the way, compact casette was also a confidential standard until Philips decided to give it away for free to gain more market...

      And these are just the standards I could think of in a second. I think more 'standards' are secret and have to be paid for than one would think.

      --
      Common sense is not so common - Voltaire
  17. Re:Too damn many smiley faces. by KilobyteKnight · · Score: 2

    Smiley rule #1: Don't use a smiley wherer even an untrained baboon could see it's humour.

    :)

    --
    When will Windows be ready for the desktop?
  18. The Dark Side of Open Source by SPrintF · · Score: 2
    Here's one of the potential problems with open-sourcing software: how many programmers write comments with an eye towards eventual publication?

    While IANAL, I am a little anal, so today my comments are OK. But, in my early days, I left a few remarks in my programs that were never intended for eyes other than my own. Ie:

    /* Yeah, yeah, I know this would be easier to code recursively, but none of the blockheads in IT understand the concept. */
    Today, I wonder if I could get corporate sponsorship for my comments.
    /* The following garbage collection routine is powered by *Starbucks*, purveyors of fine caffeinated beverages .*/
    --

    Honesty. Loyalty. Kindness. Laughter. Generosity. Magic!

  19. My personnal fav by blanalex · · Score: 2

    But maybe not from Linus:

    linux/drivers/scsi/aha1542.c:657
    panic("Foooooooood fight!");

    when the drivers detects a bad segment list

    --
    #DEFINE QUESTION (2b)||(!2b) -- William Shakespeare
  20. Re:Post your own comments by morzel · · Score: 2
    For those who don't do assembler, here's some pseudocode :

    A = A XOR B // store A XOR B in A
    /* The value of A XOR B is stored in A */

    B = B XOR A // store B XOR (A XOR B) in B
    /* B XOR (A XOR B) = B XOR B XOR A = 0 XOR A = A
    The original value of A is now stored in B */

    A = A XOR B // store (A XOR B) XOR (B XOR (A XOR B)) in A
    /* (A XOR B) XOR (B XOR (A XOR B)) =
    A XOR B XOR B XOR A XOR B =
    A XOR 0 XOR A XOR B =
    A XOR A XOR B =
    0 XOR B = B
    Store the original value of B in A
    */


    Okay... I'll do the stupid things first, then you shy people follow.

    --
    Okay... I'll do the stupid things first, then you shy people follow.
    [Zappa]
  21. Another funny comment by Jimmy_B · · Score: 2

    '&nbsp&nbsp&nbsp_______&nbsp&nbsp&nbsp&nbsp_______ __Elegance
    '&nbsp&nbsp|_______|&nbsp&nbsp|
    '&nbsp&nbsp&nbsp|&nbsp&nbsp&nbsp-=&nbsp|&nbsp&nbsp \/
    '&nbsp&nbsp&nbsp|&nbsp&nbsp&nbsp&nbsp&nbsp|_______
    '&nbsp&nbsp&nbsp|&nbsp&nbsp&nbsp&nbsp&nbsp|------- |
    '&nbsp&nbsp&nbsp|&nbsp&nbsp&nbsp&nbsp&nbsp|&nbsp&n bsp&nbsp&nbsp&nbsp&nbsp&nbsp/
    '&nbsp&nbsp&nbsp&nbsp|&nbsp&nbsp&nbsp&nbsp|&nbsp&n bsp&nbsp&nbsp&nbsp&nbsp/
    '&nbsp&nbsp&nbsp&nbsp|____|___&nbsp/

    This comment was in a VB program I wrote. I rewrote that section to work a lot better, but left the toilet in for coolness, with a note explaining what it was.

  22. Post your own comments by gunner800 · · Score: 2
    OK, OK, enough of everybody quoting their favorite comment. Post your own smartass comments here...

    //No comment

    //This crashes the system. Fix it.

    //Somebody put a useful comment here.

    //This progressive test should take about nine hours to complete. I assume it will terminate.

    //I'm not sure what this does, but it's probably important.

    (Paraphrased, originally from a CS professor:)
    # This switches the value in two registers without using a third. Technically, this is impossible. It works. Don't try to change it. If you feel the need to change it, call me at (home phone number).

    (And yes, you can exchange two variable's values without a third variable)


    Dammit, my mom is not a Karma whore!

    1. Re:Post your own comments by DanaL · · Score: 3

      A friend of mine, while trying to update some ancient (truly ancient) Cobol code, ran across a comment that went something like...

      "I don't know what this block of code does. It seems to serve no purpose, but if I remove it, the program stops working."

      I've been waiting for my chance to borrow it :)

    2. Re:Post your own comments by DanMcS · · Score: 2

      I used to grade for my compsci department, and the students put the most amazing comments in their code. Stuff like:
      i++; //increment i
      /* Dan, I don't know why this doesn't work, don't mark me off too much. */
      /* I really hate this class */
      /* yeah, I know we were supposed to do it recursively...*/

      Heh, sometimes they got an extra point for making me laugh. Shh, don't tell them that.

      --
      Communication is only possible between equals
    3. Re:Post your own comments by tamarik · · Score: 2

      in 360bal:

      xc a,b
      xc b,a
      xc a,b

      all have to exec or there is garbage in one or the other. This was an extra credit question on my assembler final in college in '85. (Yes, I got it :-)

    4. Re:Post your own comments by cotopaxi · · Score: 2

      My favorite comment was in some webobjects objective c code i had to look through. The snippet was inherited from a guy who just took off and went to germany one day.

      There was this awful loop that was nested about 5 levels deep, completely obfuscating variable names, seemed to serve no purpose, etc.

      The only comment in sight was a one-liner before the loop that said in German "I need to get some more cigarettes".

      We never did figure out what the loop did, and weeded it out of the next build.

    5. Re:Post your own comments by gunner800 · · Score: 2
      How do you post your own comments? Well, it's sort like posting anything else, except you stick a // or a /* or a # in front, depending on your native language.

      Or how do you exchange two value without a third variable? Someone posted an assembly snippit that looks like it would do it (my assembly is very rusty), but here's an algorithm:

      You have two variables of the same size, V1 and V2, which are not in the same location in memory.

      1. Set V1 = (V1 XOR V2)
      2. Set V2 = (V1 XOR V2)
      3. Set V1 = (V1 XOR V2)
      The XOR is a bitwise XOR, i.e. 1010 XOR 1100 = 0110

      This is generally not as fast as doing it the old fashioned way, but it can be good if storage is very scarce (usually registers).


      Dammit, my mom is not a Karma whore!

  23. Re:The value of a manual by Enahs · · Score: 3

    Ahhh...no, don't have a CoCo, but I *do* have an old 1000 EX (cruddy, not as open...and my old DOS 2.11 disk still works. No one should need more than 360k to store their data. :^)

    Along with the old 1000 EX I have an old DMP 130 printer (don't ya love how Tandy turns acronyms into model numbers?) The manual for the printer had nearly EVERYTHING you ever needed to know about the printer. My current HP? The manual might as well be a single sheet with the words "Magic Happens. Send it back if it's broke." :^( If it weren't for companies so busy trying to protect trade secrets, we wouldn't have this problem. I suppose companies like IBM can't be blamed too severely for this attitude; my old DMP 130 rarely got switched to native mode, instead staying in ProPrinter mode. Most folks using ProPrinter drivers on their PCs, I daresay, didn't have an IBM ProPrinter. :^)

    I just wonder what would have happened if we had had the distribution power of a deregulated Internet just, say, five years earlier when computer components were more thoroughly (or at least openly) documented. We might have had a GPLed OS, freely available, a lot sooner.

    A lot of folks credit Microsoft for taking away the need for hacking your own drivers, your own interfaces for hardware. IMHO, that's just a spin of the opinion that Microsoft has pushed hardware manufacturers to produce drivers for hardware rather than documenting interfaces. Yeah, the pre-Windows DOS world was a mess. But for folks who want to use OSs like Linux, and run head-first into undocumented hardware, it's a pain.

    --
    Stating on Slashdot that I like cheese since 1997.
  24. Out of context by brank · · Score: 2
    In linux/init/main.c:

    /*
    * Tell the world that we're going to be the grim
    * reaper of innocent orphaned children
    ...
    */
    child_reaper = current;

    In context this makes sense, but by itself it's funny.

    --
    it's green.
  25. My favorite comment by Robin+Hood · · Score: 3
    I don't know about anyone else, but the comment from sys.c was my favorite:

    /*
    * This needs some heave [sic] checking ...
    * I just haven't get the stomach for it. I also don't fully
    * understand sessions/pgrp etc. Let somebody who does explain it.
    */

    For some reason, as I was reading that comment, I saw the "I haven't got the stomach for it" part first, then I saw the "heave" checking line. In that context...

    Linus, 3 AM: Whew, that's done. I'll check it in the morning, I'm going to bed.
    Linus, 10 AM: Ugh, where's my coffee?
    Linus, 11 AM: Ahh, that's better. Now let's take a look at what I wrote last night. Yikes, that's ugly. Shouldn't have looked at that on an empty stomach... I think I'm going to be sick...
    Linus runs to the bathroom to do a little "heave" checking..
    Linus, 11:15 AM: Better write a comment to remind myself not to do that again...

    Well, that's how I pictured it anyway. :-)
    -----
    The real meaning of the GNU GPL:

    --
    The real meaning of the GNU GPL:
    "The Source will be with you... Always."
  26. Another GeoWorks fan! by DragonHawk · · Score: 2

    ... does anybody remember Geoworks? That was a cool piece of software...

    GeoWorks Ensemble! AKA PC/GEOS! Now NewDeal. That program has had more names then Prince, but it was still cool. I still miss GeoWrite. Still the best WYSIWYG word processor I've used, to this day.

    For those who don't know, PC/GEOS was a multi-tasking, multi-threading, object-oriented GUI operating environment that ran on a PC/XT with 640KB of RAM and 10 MB of hard disk. And it was pretty fast, too. A company is trying to resurrect it as NewDeal Office, but I don't put high hopes on it.

    --

    dragonhawk@iname.microsoft.com
    I do not like Microsoft. Remove them from my email address.
  27. I disagree with your feelings about GeoWorks by DragonHawk · · Score: 2

    I _hated_ Geoworks.

    Well, you're entitled to your opinion.

    The thing didn't have anything really useful...

    I suppose that depends on your definition of "really useful". Me, I was still using it for my word processor until 1997.

    ... was slow ...

    Slow? Slow?!? GeoWorks ran well on my Tandy 1000 SL with 640 KB of RAM, 40 MB HDD, and an 8 MHz Intel 8088 microprocessor! Ony my friends brand new, lightning fast 80286, screaming at 12 MHz, with a whopping 2 MB of RAM, it darn near flew!

    Any computer capable of running MS Windows 3.1 well would have made GeoWorks look like FTL travel. I can only conclude you were using a different product, had broken hardware, or were running it under MS-Windows or some such thing.

    ... was UGLY as sin.

    I didn't think so, but beauty is in the eye of the beholder.

    This was back in the day when the only use for Windows 3.1 I had was for launching up the occasional Solitare game, or to connect to AOL.

    That is interesting, because PC/GEOS included both a solitaire game, and the original version of America Online. AOL got started on PC/GEOS, because it was the only GUI worth a damn that could run on PCs way back then.

    --

    dragonhawk@iname.microsoft.com
    I do not like Microsoft. Remove them from my email address.
  28. Re:I don't know... by ucblockhead · · Score: 2

    You think that's sad...I've got one of those from a junior high typing class, circa 1978.

    Produced on a manual typewriter...

    --
    The cake is a pie
  29. I don't comment my code by goingware · · Score: 3
    I don't commend my code hardly at all, believing that if it needs comments, I haven't done my job well enough of making the code clear.

    Note that this is a distinctly different attitude than figuring you must be incompetent if you need comments in the code you're maintaining.

    Part of the reason I got to be this way is that a boss pointed out that comments are often not maintained as well as the code, and over time can actually come to be misleading. For that reason, it is best to code clearly (ie, use meaningful variable names and such).

    While this does tend to reduce the opportunity to put jokes in the source, I heard the following appeared in some pascal source written by an Apple employee:

    procedure GetDown( AndBoogie: OneMoreTime );

    Mike

    Tilting at Windmills for a Better Tomorrow
    --
    -- Could you use my software consulting serv
  30. the strangest comments i have ever seen.... by drew · · Score: 4

    a friend of mine was writing a simple assembler in Perl for a class project he was working on. the assembler consisted of two parts, the first being the preprocessor that would strip out comments and replace labels with addresses and such, and th second part being the actual assembler.

    each part worked perfectly fine by itself, but for some reason the assembler as a whole was not working. finally he was fed up enough that in the middle of the program he wrote the preprocessed assembly out to a file and then read it all back in before continuing on with the program. it worked!!! this of course made no sense whatsoever, since he was merely writing the contents of an array to a fil and reading the exact same data back in. but for some reason that made the difference in whether or not the program would run successfully.

    being rather confused at this point, he commented out the lines that he had just added to the program and ran it again. lo and behold, it still worked. but when he rmoved those lines entirely, it stopped working.

    in the end, he turned in the project with the code in the middle still in place, commented out, preceded with a comment about how utterly strange it was and a warning that the commented code should not be removed for any reason...

    only time i've ever seen comments affect the actuall execution of a program.....

    --
    If I don't put anything here, will anyone recognize me anymore?
    1. Re:the strangest comments i have ever seen.... by Anonymous Coward · · Score: 2

      IBM's BASIC compiler, version 1.00 for the PC, circa 1982, had a size limit in it somewhere. Once my program broke 1000 lines or so, the only way I could get it to compile was to sprinkle lots of comment (REM) lines in the code. Sometimes adding them at the bottom would make something at the top work. I forgot how I discovered this, but I was just grateful that something worked, since I depended on the floating point format found in that compiler. God, that was a long time ago.

  31. Re:Pity... by TwP · · Score: 2
    Blah, Blah, Blah, Blah, Blah

    Sorry, I did not mean for this to be a flame, but your comment was a little offtopic (had nothing to do with comments in the Linux kernel) and it was way too long (I am a product of pop culture and need everything in sound-bites).

    Similar to humorus comments in code are humorus variables in mathematical equations. Doing graduate studies in physics means that you often times stay up very late trying to finish homework and generally keep from going crazy (friends and Unreal Tournament help with the crazy part). One very late night my friend came up with the "coffee cup" and "smiley face" notation. This prompted me to implement the star wars notation. At the end of two pages of work I was left with the equation
    "Death Star" + "Tie Fighter" = "Light Saber"
    where "X-Wing" and "Droid" had cancelled out about half-a-page before. This is made more funny by the fact that each figure was drawn out in painstaking detail.

    I have no idea what I was trying to solve for, but it was funny as hell when I got the paper back and the solution was correct!


    ------------------------------------------------ ----------------

  32. You're misreading... by slothbait · · Score: 3

    I'm pretty sure that Linus isn't implying that this code will *never* need to be changed in subsequent versions. Rather, these are comments intended for the original small circle of people who downloaded Linux v0.1 (the first public release).

    Those guys were all hard-core hackers too. They didn't just download, untar and make, they got into the guts and tweaked, often to customize the kernel for *their* hardware. Remember the comment about > 8 MB of memory? Linux 0.1 was written for *Linus's* 386. Not i386. He was hacking on the only box he had, and he expected that others would have to tweak the kernel to get it to work well on their boxes.

    With this on everyone's minds, Linus put in this comment saying that he felt this portion of code was better tuned and more scalable than most of the kernel, and so users of v0.1 probably wouldn't need to get their hands dirty in it.

    Recall back then this stuff was all for the personal use of a few hackers. When they tweaked the kernel for their particular hardware, they would submit those tweaks to be folded into Linus's code and only *then* did Linux start to expand from "only running on Linus's PC".

    --Lenny

    1. Re:You're misreading... by Carnage4Life · · Score: 2

      *sigh*
      You talk like you haven't written code before. Many times I have written code and declared "that's it", "I'm finished", "This is code is perfect" just to have a fellow developer suggest a test which the program fails or even worse have the code fail in production because you never thought of it. This is a natural occurence that all programmers deal with whether they are hard-core Linux kernel hackers or MCSEs using Visual Basic. I was merely commenting on this humorously and not trying to besmirch almighty Linus.

      PS: If I was a hard-core hacker(who says I'm not) and I saw a piece of code that said DON'T CHANGE ME while looking through some source code which was specific to 1 person's machine chances are that I would change the code to be more general. Especially if I had access to a different kind of machine from the original developer. Methinks a redefinition of your idea of hard-core hacker is needed.

    2. Re:You're misreading... by slothbait · · Score: 2

      You talk like you haven't written code before

      Why? Because I was trying to remind everyone of the intended audience of Linus's comments and code? That's just a historical consideration that I don't want lost in the noise.

      Of course I program...lately it's been all ASM test code for 8051 microcontrollers. "Bare metal" stuff, I guess. You seem to be a programmer, but if your sig is true, then you can't possibly be a "real programmer". Ah...debating sigs on Slashdot on Saturday morning. I guess I'm not a "real programmer", either...

      Look, I understand your point just fine, and I've certainly felt it myself. However, I don't think Linus's comment supports your case. This wasn't "production quality" code ... it was very much a work in progress. And I know you weren't trying to besmirch Linus. Hell, Linus doesn't need defending. It's RMS that needs defending, and I find myself doing it regularly...

      I really just think it's important to keep in mind who the intended audience of the original code really was. I feel it's an important historical consideration for the Free Software movement.

      I realize fully that hard core hackers tinker. I don't claim to be hardcore, but one of the things about my job that I love the most is replacing crappy, poorly done code that I've inherited from other engineers...most of whom don't like to code as much as I. But there was probably a hell of a lot to tinker with in the kernel just to get it to run on new systems back then. Getting it to run was the most important -- then the programmer can dive in and make it better.

      --Lenny

  33. Get off it. by slothbait · · Score: 2

    Man, this was 1991. Smileys weren't cliche then, and teenage girls certainly didn't hang out on alt.cuddle back then.

    You know what? Bell bottoms look dumb today, too.

    Alright, alright...so they looked dumb *back then* too. /me should have picked a better example.

    --Lenny

  34. Re:There is no substance here. Who modded this up? by Carnage4Life · · Score: 2

    >>Amiga were fighting with Atari.
    >Atari had been dead for five years at this point.

    Whatever, I seem to remember my friends having an Atari ST which competed directly with the Amiga 500 when I was in high school. I graduated high school in '94 which is 8 years after which you claim Atari had died. It is obvious that you are the one that doesn't know that of which he speaks.

  35. Not so ancient.. but still funny by Panaflex · · Score: 2

    +#if defined(__alpha__) && defined(CONFIG_PCI)
    + /*
    + * The meaning of life, the universe, and everything. Plus
    + * this makes the year come out right.
    + */
    + year -= 42;
    +#endif
    (From the patch for 1.3.2: (kernel/time.c), submitted by Marcus Meissner)

    Linux is obsolete
    (Andrew Tanenbaum)

    lp1 on fire
    (One of the more obfuscated kernel messages)

    /*
    * Oops. The kernel tried to access some bad page. We'll have to
    * terminate things with extreme prejudice.
    */
    die_if_kernel("Oops", regs, error_code);
    (From linux/arch/i386/mm/fault.c)

    /*
    * [...] Note that 120 sec is defined in the protocol as the maximum
    * possible RTT. I guess we'll have to use something other than TCP
    * to talk to the University of Mars.
    * PAWS allows us longer timeouts and large windows, so once implemented
    * ftp to mars will work nicely.
    */
    (from /usr/src/linux/net/inet/tcp.c, concerning RTT [retransmission timeout])

    Yanked from fortune...
    Pan

    --
    I said no... but I missed and it came out yes.
  36. My favorite by KillBot · · Score: 2

    arch/sparc/kernel/ptrace.c:/* Fuck me gently with a chainsaw... */

    Copyright (C) 1996 David S. Miller (davem@caipfs.rutgers.edu)

  37. "magic happens" by Malk-a-mite · · Score: 3
    " /* I know - shouldn't do this, but .. */ "

    I feel better now, these words have gotten me in more trouble than anything else.

    Malk-a-mite

  38. Comments are a time capsule. by Mija+Cat · · Score: 4

    Comments in code are like a time capsule, from one programmer to another. They communicate what the code does, but also the mood of the author.

    My first coding job was cleaning and adding "improvements" to some anchient and nasty C code.
    Some of the comments described the previous programmers' marital problems, opinions on co-workers, etc.
    It made a sucky job more bearable.

    Meow!

    --
    Yes, that's really my e-mail. Don't change a thing.
  39. this is a dumb comment i knew someone would make by Hollins · · Score: 5

    Why didn't you post Linus' entire comment?

    For those with more memory than 8 Mb - tough luck. I've
    * not got it, why should you :-) The source is here. Change
    * it. (Seriously - it shouldn't be too difficult. Mostly
    * change some constants etc. I left it at 8Mb, as my machine
    * even cannot be extended past that (ok, but it was cheap :-)
    * I've tried to show which constants to change by having
    * some kind of marker at them (search for "8Mb"), but I
    * won't guarantee that's all :-( )

    Bill Gates didn't include source code and encourage others to change it. He wasn't saying it in jest, and he was not referring to an Alpha release.

    All this making you the bigger idiot.

  40. Can Someone Answer This.... by Carnage4Life · · Score: 5

    from sched.c:

    /*
    * 'schedule()' is the scheduler function. This is GOOD CODE! There
    * probably won't be any reason to change this, as it should work well
    * in all circumstances (ie gives IO-bound processes good response etc).

    Okay can anyone tell me how many times they have thought the exact same thing about their only for somebody else to suggest a scenario or even worse use it "improperly" and find a bug. I think I'm up to several dozen times... :-)


  41. My favorites by DragonHawk · · Score: 2

    Somebody already posted the start of the cmd640.c file, but I haven't seen any quotes from srmmu.c, which had me ROTFL when I first read them.

    #if 0 /* I think this is bad news... -DaveM *

    /* And one more, for our good neighbor, Mr. Broken Cypress. */

    /* Gee george, I wonder why Sun is so hush hush about this hardware bug... really braindamage stuff going on here. However I think we can find a way to avoid all of the workaround overhead under Linux. Basically, any page fault can cause kernel pages to become user accessible (the mmu gets confused and clears some of the ACC bits in kernel ptes). Aha, sounds pretty horrible eh? But wait, after extensive testing it appears that if you use pgd_t level large kernel pte's (like the 4MB pages on the Pentium) the bug does not get tripped at all. This avoids almost all of the major overhead. Welcome to a world where your vendor tells you to, "apply this kernel patch" instead of "sorry for the broken hardware, send it back and we'll give you properly functioning parts" */

    /* You see Sun allude to this hardware bug but never admit things directly, they'll say things like, "the Swift chip cache problems" or similar. */

    /* Are you now convinced that the Swift is one of the biggest VLSI abortions of all time? Bravo Fujitsu! Fujitsu, the !#?!%$'d up processor people. I bet if you examined the microcode of the Swift you'd find XXX's all over the place. */

    /* TurboSparc is copy-back, if we turn it on, but this does not work. */

    /* Emulate VLSI abortion number three, not number one */

    /* Tsunami's pretty sane, Sun and TI actually got it somewhat right this time. Fujitsu should have taken some lessons from them. */

    /* Ahhh, the viking. SRMMU VLSI abortion number two... */

    /* Oh well */
    srmmu_is_bad();

    /* El switcheroo... */

    --

    dragonhawk@iname.microsoft.com
    I do not like Microsoft. Remove them from my email address.
  42. The value of a manual by Woodmeister · · Score: 3
    ...snip...

    /*Don't know why, and I haven't tested it on a drive with
    * more than 8 heads, but that is what the bios-listings seem to imply. I
    * just love not having a manual.

    */

    Tell me about it. One of the things I used to love about purchasing computer parts years ago were the schematics, programming info, etc.....

    I used to own a Tandy Color Computer 3 years ago, and it was quite the little workhorse. Small, very modular (tho this was problem if you had floppy,HD,RS-232,controllers,etc... -- thing got messy), and was remarkably easy to program. It had fairly advanced HW for the time (decent MMU; better graphics than CGA and on par with EGA), and was much cheaper than an full 'IBM PC' (remember when?).

    One of the killers of this little jewel was the PC/MSDOS hedgemony (later to become Intel/Windows) of software. Many users such as myself were interested in electronics and interfacing, and we loved to use our CoCo's for neat'n'easy projects. This required us to write our own software, interface with hardware at the driver level, and do other hacks to get things to our satisfaction. When we needed to use available hardware for whatever reason, nothing beat a useful manual to help make life much easier. Nothing worse than stabbing in the dark.

    Ahh. My CoCo. I truly loved that machine. Anyone else here a former CoCo addict?
    --
    You're still using Windows?

    --

    Quando Omni Flunkus Moritati
    -Possum Lodge Motto
  43. Wrote this one just yesterday by xant · · Score: 2
    I like to comment other peoples' code. For example:

    // And what exactly does THIS do? Comments sure can be helpful.

    --
    It's rare that you're presented with a knob whose only two positions are Make History and Flee Your Glorious Destiny.
  44. I like this linux source comment by tap · · Score: 5

    It's from the driver for the cmd640 IDE chipset.

    * This file provides support for the advanced features and bugs
    * of IDE interfaces using the CMD Technologies 0640 IDE interface chip.
    *
    * These chips are basically fucked by design, and getting this driver
    * to work on every motherboard design that uses this screwed chip seems
    * bloody well impossible. However, we're still trying.

  45. Ever heard of ANSI? by Hollins · · Score: 2

    They charge out the wazoo for their standards. Even if you're just downloading a copy from their website.

  46. commenting forms community by griffjon · · Score: 4

    I wonder how much this early commenting helped form the Linux programmer community and shape it's atmmosphere early on? Getting the self abasing and also highly informative comments delivered to an audience of peers (...even if you weren't a peer, it made you feel like one to read those comments)

    --
    Returned Peace Corps IT Volunteer
  47. VB 3.0 took time to execute comments by divec · · Score: 3

    While we're at it, I thought I'd point the above out. I remember calibrating delay loops by putting things like REM : REM : REM : REM : REM in. I mean, y'd expect it to cause a delay when running interpreted, but not in the compiled version. I suspect that VB "executable" files probably just had a stub at the beginning that loaded a DLL to interpret the (obfuscated?) code within the rest of the "executable".

    --

    perl -e 'fork||print for split//,"hahahaha"'

  48. Another one... by Booker · · Score: 2

    I wanted to make my own MICR font so I could try writing a free check-printing program... big bucks for all that stuff, too (MICR character definitions, character placement, check dimensions, etc...)

    I finally found some of it on a canadian bank org's website - probably not supposed to be there. :)

    ---

  49. ASCII PORN by Anonymous Coward · · Score: 2

    &nbsp&nbsp&nbsp&nbsp&nbsp±±±±
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp±±±±±
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp±±±±
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp±±±±±
    &nbsp&nbsp&nbsp&nbsp&nbsp±±±±±±
    &nbsp&nbsp&nbsp&nbsp±±±±±
    &nbsp&nbsp&nbsp&nbsp±±±±±
    &nbsp&nbsp&nbsp&nbsp±±±±±
    &nbsp&nbsp&nbsp&nbsp&nbsp±±±±±±
    &nbsp&nbsp&nbsp&nbsp±±ÛÛ±±
    &nbsp&nbsp&nbsp&nbsp±±±±ÛÛ±±
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp±±±±±±ÛÛ
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp±±±±±± ÛÛ
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp±±±±± ± ±
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp±±±±± ±±±± ±
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp &nbsp±±±±±±±±± ±±±±
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp &nbsp±±±±±±±±±±±±±±±±± ±±±±±±
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp &nbsp&nbsp±±±±±±±±± ±±±±±±±±±±
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp &nbsp&nbsp±± ±±±±±±
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp &nbsp&nbsp&nbsp±± ±±±±