Skip to main content
GameDev.net gamedev.net
🔒 Locked

joke code

Started by JohnnyCode Apr 19, 2012 at 4:32 PM 13 replies 2.9k views
Original Post
JohnnyCode
JohnnyCode
Besides normal classic jokes, there is a funny thing that only we programers can laugh at. Here are two code jokes I made up:


try{
obj.Run(x);
catch
{
obj.Run(x);
}


and this


if (x==5)
x=5;
fastcall22
fastcall22
Hmm? I don't get it. It looks like code I encounter on a daily basis...
way2lazy2care
way2lazy2care

Hmm? I don't get it. It looks like code I encounter on a daily basis...

It's like making holocaust jokes in front of holocaust survivors.
irreversible
irreversible

[quote name='fastcall22' timestamp='1334853299' post='4932860']
Hmm? I don't get it. It looks like code I encounter on a daily basis...

It's like making holocaust jokes in front of holocaust survivors.
[/quote]

Uh no...
Servant of the Lord
Servant of the Lord

It's like making holocaust jokes in front of holocaust survivors.

3rd post, and Godwin's law takes effect already. And it's a thread about programming. sleep.png
Servant of the Lord
Servant of the Lord

Besides normal classic jokes, there is a funny thing that only we programers can laugh at. Here are two code jokes I made up:


try{
obj.Run(x);
catch
{
obj.Run(x);
}

That, depending on what the function call does, may actually be valid code (though it may not be smart code, it is valid and might be intentional). Unlike your second example, it actually has an effect on the code.

I thought this thread was about things like this:
#define NULL 0xFFFFFFF
#define true false
#define if(x) if(!(x))
#define while(x) if(x)


laugh.png
Bacterius
Bacterius
My favorite is still by far:

#define false random()%2
#define true random()%2


This one is a classic too:

#define break continue
“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”
Ravyne
Ravyne
My favorite is "while(1);"... placed on any random line, about 80 tabs out.

For bonus points, include a comment mocking the intended victim, preferably one calling into question the ethics of his mother around farm animals.
throw table_exception("(? ???)? ? ???");
FableFox
FableFox

My favorite is still by far:

#define false random()%2
#define true random()%2


This one is a classic too:

#define break continue


oh my god, don't tell me you secretly put that into someone code.. oh.. the debugging...
FableFox
FableFox

My favorite is "while(1);"... placed on any random line, about 80 tabs out.

For bonus points, include a comment mocking the intended victim, preferably one calling into question the ethics of his mother around farm animals.


this one is less useful, I think there is a breakpoint or something that you can stop and the editor will show the location of the code.
Ravyne
Ravyne

[quote name='Ravyne' timestamp='1335071217' post='4933710']
My favorite is "while(1);"... placed on any random line, about 80 tabs out.

For bonus points, include a comment mocking the intended victim, preferably one calling into question the ethics of his mother around farm animals.


this one is less useful, I think there is a breakpoint or something that you can stop and the editor will show the location of the code.
[/quote]

Depends on whether your intent is to drive them mad, or to deliver a more vicious payload
throw table_exception("(? ???)? ? ???");
Promit
Promit
Guys, don't go into comedy.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Sik_the_hedgehog
Sik_the_hedgehog
oh my god, don't tell me you secretly put that into someone code.. oh.. the debugging...

I've seen worse examples:
// In the middle of a giant header nobody wants to
// look into but that's included about everywhere
#define if(x) if((x) && (rand() & 0x7FFF) != 0x1234)

Good luck debugging that.
Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.
Servant of the Lord
Servant of the Lord

[quote name='fastcall22' timestamp='1334853299' post='4932860']
Hmm? I don't get it. It looks like code I encounter on a daily basis...

And you're the only programmer on the team!

(I challenge you all to make a worse joke)
[/quote]

Altered fastcall22 post
It looks like code I encounter on a daily basis... And I was the lead developer for Windows NT.
[/quote]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.