Jump to content

  • Log In with Google      Sign In   
  • Create Account

joke code


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
14 replies to this topic

#1 JohnnyCode   Members   -  Reputation: 230

Posted 19 April 2012 - 10:32 AM

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;


Sponsor:

#2 fastcall22   Crossbones+   -  Reputation: 4345

Posted 19 April 2012 - 10:34 AM

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

#3 way2lazy2care   Members   -  Reputation: 782

Posted 20 April 2012 - 08:41 AM

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.

#4 irreversible   Crossbones+   -  Reputation: 1354

Posted 21 April 2012 - 05:14 PM


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.


Uh no...

#5 Servant of the Lord   Crossbones+   -  Reputation: 19662

Posted 21 April 2012 - 07:01 PM

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. Posted Image
It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


#6 Servant of the Lord   Crossbones+   -  Reputation: 19662

Posted 21 April 2012 - 07:04 PM

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)

Posted Image
It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


#7 Bacterius   Crossbones+   -  Reputation: 8947

Posted 21 April 2012 - 09:27 PM

My favorite is still by far:

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

This one is a classic too:

#define break continue

The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis


#8 Ravyne   GDNet+   -  Reputation: 7485

Posted 21 April 2012 - 11:06 PM

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.

#9 FableFox   Members   -  Reputation: 509

Posted 21 April 2012 - 11:08 PM

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...
Fable Fox is Stronger <--- Fable Fox is Stronger Project

#10 FableFox   Members   -  Reputation: 509

Posted 21 April 2012 - 11:09 PM

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.
Fable Fox is Stronger <--- Fable Fox is Stronger Project

#11 Ravyne   GDNet+   -  Reputation: 7485

Posted 21 April 2012 - 11:11 PM


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.


Depends on whether your intent is to drive them mad, or to deliver a more vicious payload :)

#12 Promit   Moderators   -  Reputation: 7213

Posted 21 April 2012 - 11:26 PM

Guys, don't go into comedy.

#13 Sik_the_hedgehog   Crossbones+   -  Reputation: 1757

Posted 22 April 2012 - 01:32 AM

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.

#14 Wan   Members   -  Reputation: 1366

Posted 22 April 2012 - 10:01 AM

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)

#15 Servant of the Lord   Crossbones+   -  Reputation: 19662

Posted 22 April 2012 - 10:31 AM


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)


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


It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS