Entertaining Bits From The Ancient Kernel Tree 171
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."
Pope hating (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...
Colorful Comments (Score:3)
You can also search the linux-kernel mailing list archives for some lively debates about "cleaning up the language in the kernel source"...
Re:Try again (Score:1)
Enlightenment build (Score:1)
checking for XF86VidModeQueryExtension in -lXxf86vm... yes ./config.cache
checking for mass_quantities_of_bass_ale in -lFridge... no
checking for mass_quantities_of_any_ale in -lFridge... no
Warning: No ales were found in your refrigerator.
We highly suggest that you rectify this situation immediately.
updating cache
Obviously I should have used "configure --without-ads".......
Re:The value of a manual (Score:1)
Absolutely. I actually started using the thing back when it was new, and I was so much cooler than any of the other second graders because I knew how to use a computer and they didn't. It wasn't a CoCo1, because nobody had thought that there was going to be a CoCo2 yet. I remember how exciting it was when we upgraded from 4 kB and Color Basic to 16 kB and Extended Color Basic.
The old CoCo tape "drive" also taught me the importance of backing up vital data. For those who don't know, the CoCo had a very cheesy interface that let you use your regular home tape player and audio casettes as a storage medium. Unfortunately, the results were (as you'd expect) really poor. Whenever you wrote a program that you wanted to keep, you always had to make at least 10 copies onto the damn tape because you knew that they were going to degrade like anyting and that way you had a chance to recover one copy and make 10 more.
Re:Post your own comments (Score:1)
I don't know. I find that real comments from real code can be tremendously amusing. One of my all time favorites was:
What person that's worked to modify someone else's code hasn't felt that way at one time or another?
Re:this is a dumb comment i knew someone would mak (Score:1)
Who dunnit?
It must have been Emmett...
Re:Wrote this one just yesterday (Score:2)
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.
Re:The value of a manual (Score:1)
Re:Post your own comments (Score:2)
# 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.
Re:POSIX wanted money for a *standard* (Score:1)
Re:As far as finding the Rainbow series online.... (Score:1)
Comments... (Score:1)
have become the core business of certain websites!
Comments on this?
Re:Post your own comments (Score:2)
; 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? */
Re:There is no substance here. Who modded this up? (Score:1)
Definetly by 94 Atari was pretty much dead and Amiga was on it's way out. I remember using my Amiga 500 from about 89 until 94 and few years later I gave it away. This would have been about from 3rd grade until 8th grade. By the time I got to high school it was pretty much obsolete..
NOT a troll! (Score:1)
As far as finding the Rainbow series online.... (Score:1)
"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.
Malk-a-mite
What else do you all put into your code? (Score:2)
Or sometimes I just get wacky:
The other approach is creative "self-documenting code":
$ridiculous_index =
while ($LoopUntilWeDie)
--
Re:As far as finding the Rainbow series online.... (Score:1)
Sorry for the double post, found the other site with the magic books.
Trusted Network Interpretation Environments Guideline - Guidance for Applying the TNI, 1 August 1990. (Red Book)
DoD Password Management Guideline, 12 April 1985. (Green Book)
That's Orange, Red, Green. Enjoy all.
Malk-a-mite
Re:As far as finding the Rainbow series online.... (Score:3)
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.
Re:As far as finding the Rainbow series online.... (Score:1)
OS of Satan (Score:2)
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.
Re:That's a classic (Score:1)
Linus knows you'll need more... He just didn't care about doing it in an alpha release
Re:That's a classic (Score:1)
Someone else points out that Bill Gates didn't say it (urben legend)
and Linus knew you needed more...
Also when Bill Gates made his comment programs were packed in 64k..
The 640k memory Limit on Dos was a hardware issue...
The Intel processor only addresses 1 meg in "native" mode... the 8088/86 only addressed 640k...
While a 286 can have much more ram than 640k it can only be accessed in protected mode...
So it is out of the reach of DOS.
And thats why MsDos can only access 640k of ram.. that and if it trys to access the full meg programs crash...
However.... during the same time period programmers were saying "I need 4 meg of ram all to myself" for mainframes... it was only a matter of time before they'd start demanding it on home computers....
But... no... we need 16 meg of VIDEO ram... and 512meg of system ram... 10 gig HD... 100 meg removable disk... and 128k BPS feed...
I mean... IBM expected us to dump the PC a long time ago...
Who knows...
Anyway at time it was rummored to have been said... it was true....
Amusing build comments (Score:1)
Checking for plesiosaurs in Loch Ness - ok
(been passed it a couple of times a week and haven't seen _one_ yet)
Cheers,
Gordonjcp
me@gordonjcp.co.uk
Re:There is no substance here. Who modded this up? (Score:1)
I don't know about that... win 3.0 was my first exposure to windows, and I don't know about you guys, but 3.0 SUCKED. I mean, all windows suck, but 3.0 really sucked. Compared to 3.0, 3.1 was a dream to work with. I personally think that it was with 3.1 that (publically anyway) MS became the leader.
Now that said, there wasn't really another company doing the sort of thing that windows was (at least with the advertising clout that MS had).
Re:Enlightenment build (Score:1)
Re:This isn't terribly funny (Score:1)
Re:I don't know... (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
Too damn many smiley faces. (Score:1)
----------
I see you (Score:2)
There you go again. I know what you're up to.
Your fan WDK - WKiernan@concentric.net
ps: send me to Europe!
Slightly offtopic but... (Score:5)
http://slashdot.org/co mments.pl?sid=00/06/08/0647212&cid=574 [slashdot.org].
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
Re:There is no substance here. Who modded this up? (Score:1)
Shouldn't it be:
Bill Gates opened the Pandora box and then Win32 was released ;).
not flame, no never never flame (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
Comments in VB (Score:2)
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!
Re:What else do you all put into your code? (Score:2)
/*
* 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
Sort of eerie (Score:5)
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.
Re:Sort of eerie (Score:1)
-legolas
i've looked at love from both sides now. from win and lose, and still somehow...
Re:Too damn many smiley faces. (Score:1)
That's a classic (Score:3)
-- Linus Torvalds, 1991
"Nobody will ever need more than 640k RAM!"
-- Bill Gates, 1981
So who's the bigger idiot?
POSIX wanted money for a *standard* (Score:3)
* 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).
Re:Too damn many smiley faces. (Score:2)
This isn't terribly funny (Score:1)
Re:Slightly offtopic but... (Score:2)
; Speed not high priority here.
Seems so...fitting, in an M$ product
He may be a good hacker... (Score:1)
The Dark Side of Open Source (Score:2)
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:
Today, I wonder if I could get corporate sponsorship for my comments.My personnal fav (Score:2)
linux/drivers/scsi/aha1542.c:657
panic("Foooooooood fight!");
when the drivers detects a bad segment list
Re:I don't see genius (Score:1)
Swapping 2 without 3rd if both positive numbers (Score:1)
b=a-b
a=a-b
Bob.
Re:Another GeoWorks fan! (Score:1)
--Fesh
how insightful and important to life (Score:1)
Re:Colorful Comments (Score:1)
fgrep -ir fuck * /* XXX actually EFUCKUP */ /* XXX actually EFUCKUP */ /* XXX actually EFUCKUP */ /* Things are seriously fucked up. c : return(EFTYPE); /* XXX actually EFUCKUP */ : return(EFTYPE); /* XXX actually EFUCKUP */ /* XXX actually EFUCKUP */ /* Things are seriously fucked up. c : return(EFTYPE); /* XXX actually EFUCKUP */ : return(EFTYPE); /* XXX actually EFUCKUP */ /* XXX actually EFUCKUP */ /* Things are seriously fucked up.
alpha/tc/esp.c: * Things are seriously fucked up.
boot/alpha/libalpha/elf_freebsd.c: return(EFTYPE);
boot/i386/libi386/aout_freebsd.c: return(EFTYPE);
boot/i386/libi386/elf_freebsd.c: return(EFTYPE);
i386/isa/aic6360.c:
modules/pcic/@/alpha/tc/esp.c: * Things are seriously fucked up.
modules/pcic/@/boot/alpha/libalpha/elf_freebsd.
modules/pcic/@/boot/i386/libi386/aout_freebsd.c
modules/pcic/@/boot/i386/libi386/elf_freebsd.c: return(EFTYPE);
modules/pcic/@/i386/isa/aic6360.c:
modules/svr4/@/alpha/tc/esp.c: * Things are seriously fucked up.
modules/svr4/@/boot/alpha/libalpha/elf_freebsd.
modules/svr4/@/boot/i386/libi386/aout_freebsd.c
modules/svr4/@/boot/i386/libi386/elf_freebsd.c: return(EFTYPE);
modules/svr4/@/i386/isa/aic6360.c:
fgrep -ir shit *
Binary file compile/ROSENCRANTZ/vfs_cache.o matches
Binary file compile/ROSENCRANTZ/kernel matches
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
kern/vfs_cache.c:static u_long numposhits; STATNODE(CTLFLAG_RD, numposhits, &numposhits);
kern/vfs_cache.c: numposhits++;
Binary file modules/pcic/@/compile/ROSENCRANTZ/vfs_cache.o matches
Binary file modules/pcic/@/compile/ROSENCRANTZ/kernel matches
modules/pcic/@/dev/sym/sym_hipd.c: * brain-deaded stuff that makes shit.
modules/pcic/@/i386/i386/math_emu.h: * structure to 12 bytes which breaks things in math_emulate.c. Shit. I
modules/pcic/@/kern/vfs_cache.c:static u_long numposhits; STATNODE(CTLFLAG_RD, numposhits, &numposhits);
modules/pcic/@/kern/vfs_cache.c: numposhits++;
Binary file modules/svr4/@/compile/ROSENCRANTZ/vfs_cache.o matches
Binary file modules/svr4/@/compile/ROSENCRANTZ/kernel matches
modules/svr4/@/dev/sym/sym_hipd.c: * brain-deaded stuff that makes shit.
modules/svr4/@/i386/i386/math_emu.h: * structure to 12 bytes which breaks things in math_emulate.c. Shit. I
modules/svr4/@/kern/vfs_cache.c:static u_long numposhits; STATNODE(CTLFLAG_RD, numposhits, &numposhits);
modules/svr4/@/kern/vfs_cache.c: numposhits++;
For brevity, all references to "Matsushita" have been surgically removed. Even my kernel binary is full of shit (yes, I know that "numposhits" is "number of positive hits").
Also, on an unrelated note, the XOR-exchange of variables is quite a bit slower than using a temp, at least on the x86.
-jtm
my favorite comment to put in code (Score:1)
Re:Post your own comments (Score:1)
Straight from my current project:
int j; // once a control variable/now a counter/life is like that
Re:What else do you all put into your code? (Score:1)
I remember getting ticked at the TA once and writing a comment about how they grade comments. I meant to remove it, but forgot.
#include string.h
I got a nasty email back, and I appologized. However, it is interesting to note that my poorly documented code that outperformed every other students code in every area got worse grades than code that didn't even work. I remember not even implementing a function, and commenting that it didn't work, and getting a 100% on the assignment still.
I don't know why they were more concerned about the comments than the code.
^~~^~^^~~^~^~^~^^~^^~^~^~~^
Re:The value of a manual (Score:1)
I had to downgrade to MS-DOS...then Windows...and now I'm actually back up to a real multitasking OS with Linux!
In some ways, Linux fulfills a lot of the dreams that CoCo/OS-9 users had.
Re:Sort of eerie (Score:1)
Kinda like talking about what went on before the Big Bang, yes?
Re:Post your own comments (Score:2)
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.
Re:The value of a manual (Score:1)
This is all most people want to know. I'm sure it costs money to create decent end-user documentation. If 99.9% of the people buying your product get scared by the 400 page manual complete with fold out schematics in the back, why would they spend the money (even if they weren't concerned about clones)?
With the cost of producing a printer (or other HW) these days, yeah, bring the thing back and they'll give you a new one.
Now, back when I paid $1000 for the Lt. Kernel hard drive for my C=64, that was a differnet story.
(One of the best I got was a black book that came with a $700 modem. Incredible.)
Another funny comment (Score:2)
'  |_______|  |
'   |   -= | &nbs
'   |     |______
'   |     |------
'   |     | &
'    |    | &
'    |____|___ /
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.
Post your own comments (Score:2)
//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!
Re:The value of a manual (Score:3)
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."
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.
Out of context (Score:2)
* 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.
My favorite comment (Score:3)
* 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:
Another GeoWorks fan! (Score:2)
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 [newdealinc.com], but I don't put high hopes on it.
I disagree with your feelings about GeoWorks (Score:2)
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.
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.
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.
Re:I don't know... (Score:2)
Produced on a manual typewriter...
I don't comment my code (Score:3)
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
Re:Post your own comments (Score:3)
"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
the strangest comments i have ever seen.... (Score:4)
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.....
Re:Pity... (Score:2)
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!
-----------------------------------------------
Re:Post your own comments (Score:2)
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.
You're misreading... (Score:3)
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
Re:What else do you all put into your code? (Score:5)
// what the hell is with this magic number crap?
//
...
// 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
Get off it. (Score:2)
You know what? Bell bottoms look dumb today, too.
Alright, alright...so they looked dumb *back then* too.
--Lenny
Re:Post your own comments (Score:2)
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
Re:You're misreading... (Score:2)
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.
Re:There is no substance here. Who modded this up? (Score:2)
>Atari had been dead for five years at this point.
Whatever, I seem to remember my friends having an Atari ST [yahoo.com] 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.
Re:You're misreading... (Score:2)
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
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
Not so ancient.. but still funny (Score:2)
+
+ * 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
Yanked from fortune...
Pan
My favorite (Score:2)
Copyright (C) 1996 David S. Miller (davem@caipfs.rutgers.edu)
"magic happens" (Score:3)
I feel better now, these words have gotten me in more trouble than anything else.
Malk-a-mite
Comments are a time capsule. (Score:4)
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!
this is a dumb comment i knew someone would make (Score:5)
For those with more memory than 8 Mb - tough luck. I've
* not got it, why should you
* 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.
Can Someone Answer This.... (Score:5)
* '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...
My favorites (Score:2)
#if 0
/* 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... */
The value of a manual (Score:3)
* 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?
Wrote this one just yesterday (Score:2)
I like this linux source comment (Score:5)
* 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.
Re:Post your own comments (Score:2)
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.
Re:the strangest comments i have ever seen.... (Score:2)
Re:Post your own comments (Score:2)
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.
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!
Re:POSIX wanted money for a *standard* (Score:2)
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 $$$$$
Re:Colorful Comments (Score:2)
# 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:
drivers/scsi/esp.c:
drivers/scsi/esp.c:
drivers/scsi/esp.h:
drivers/scsi/NCR53C9x.c:
drivers/scsi/NCR53C9x.c:
drivers/scsi/NCR53C9x.h:
# 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:
arch/sparc/kernel/sunos_ioctl.c:
arch/mips/kernel/irixelf.c:#if 0
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:
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:
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:
drivers/cdrom/sbpcd.c: CURRENT=req->next;
drivers/video/tgafb.c:
include/asm-sparc64/system.h:
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.
Ever heard of ANSI? (Score:2)
Re:POSIX wanted money for a *standard* (Score:4)
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.
commenting forms community (Score:4)
VB 3.0 took time to execute comments (Score:3)
Another one... (Score:2)
I finally found some of it on a canadian bank org's website - probably not supposed to be there.
---
ASCII PORN (Score:2)
      ±±±±±
       ±±±±
      ±±±±±
     ±±±±±±
    ±±±±±
    ±±±±±
    ±±±±±
     ±±±±±±
    ±±ÛÛ±±
    ±±±±ÛÛ±±
      ±±±±±±ÛÛ
       ±±±±±± ÛÛ
         ±±±±
         ±±±±
         &nbs
         &nbs
         &nbs
         &nbs
         &nbs