try{
obj.Run(x);
catch
{
obj.Run(x);
}
and this
if (x==5) x=5;
Posted 21 April 2012 - 07:01 PM
3rd post, and Godwin's law takes effect already. And it's a thread about programming.It's like making holocaust jokes in front of holocaust survivors.
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
Posted 21 April 2012 - 07:04 PM
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.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); }
#define NULL 0xFFFFFFF #define true false #define if(x) if(!(x)) #define while(x) if(x)
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
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
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.
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.
Posted 22 April 2012 - 01:32 AM
I've seen worse examples:oh my god, don't tell me you secretly put that into someone code.. oh.. the debugging...
// 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.
Posted 22 April 2012 - 10:01 AM
And you're the only programmer on the team!Hmm? I don't get it. It looks like code I encounter on a daily basis...
Posted 22 April 2012 - 10:31 AM
And you're the only programmer on the team!
Hmm? I don't get it. It looks like code I encounter on a daily basis...
(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.
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