PDA

View Full Version : Silly Jokes



Snafuist
02-24-2009, 03:15 PM
Hi everyone,

I'm a huge fan of silly code snippets, made up and real ones. Here are some of my favorites:



int getRandomNumber()
{
return 4; // carefully chosen by rolling a dice
}





while(1)
fork();





/* no comment */





#define moin main

int moin(int argc, char *argv[]) {
// ...
}


If your German is a bit rusty, the last one probably needs some explanation: "moin" is generally accepted as short for "Guten Morgen"/"Hallo", which means "Good Morning"/"Hello" in English.

What else have you got?

Greets,
Philip

MK27
02-24-2009, 03:37 PM
Trust people who name operating systems after horned beasts: How the way people code "Hello World" varies (www.gnu.org/fun/jokes/helloworld.html)

My fav's were the "seasoned hacker" and "guru hacker"...!

Which is the same place I found "C+-: The first subject-oriented programming language". Hahaha...

ps. the only people who say "Good Morning"/"Hello" in English now-a-days are the same schizoid meglomaniacs who say "See You Later"/"Good Bye"/(pause)/"Farewell" and then throw in some Italian and Portuguese just to be sure.

stevesmithx
02-25-2009, 07:24 AM
Here are some very good math formulae (http://www.morenewmath.com/all/)

Salem
02-25-2009, 11:52 AM
Does this describe anyone near you?


struct freelancer {
short temper;
long lunch;
double money;
void *work;
char unstable;
};


More here
http://www.gnu.org/fun/jokes/declarations.html

jEssYcAt
02-26-2009, 01:38 AM
one that I used in a program (http://cboard.cprogramming.com/showpost.php?p=435961&postcount=1) a while back:

#define hello int
#define world main
/* some other defines... */
hello world(hello World,hellO* WorlD he1L0) {...

happyclown
02-26-2009, 06:13 PM
one that I used in a program (http://cboard.cprogramming.com/showpost.php?p=435961&postcount=1) a while back:

#define hello int
#define world main
/* some other defines... */
hello world(hello World,hellO* WorlD he1L0) {...


I like it!, even I have no idea how that code can create that output! :D

Snafuist
03-02-2009, 07:40 PM
/* some other defines... */


Nice understatement!


Here's some more silly stuff:



/* YOUR KUNG-FU IS OLD AND NOW YOU MUST DIE!! */
exit(0);


From a Makefile:



love:
@echo not war.


And the famous comment from Unix Sixth Edition source code:



/* You are not expected to understand this */


More funny stuff can be found on Dennis Ritchie's homepage (http://cm.bell-labs.com/cm/cs/who/dmr/odd.html).


And for some profound insight on the quality of Linux source code, try the following:



grep -R "[Ff]uck" /usr/src/linux/


Greets,
Philip