Jump to content

  • Log In with Google      Sign In   
  • Create Account


Funniest line of code ever ?

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

#61 aregee   Members   -  Reputation: 1019

Like
0Likes
Like

Posted 26 August 2014 - 07:33 AM

 


Even on the old Commodore Amiga computers, it was regarded bad practise to make timing loops like that.

The Amiga had different CPU speeds across models, though. Busy loops are reliable only when you know the CPU speed perfectly (and you know other hardware won't mess up with it, like e.g. power management features).

 

 

Yes, that is very true, still people (ab)used busy loops on that platform, at least in the early days before the faster models came around and wrecked havoc on old programs.



Sponsor:

#62 mhagain   Crossbones+   -  Reputation: 7865

Like
5Likes
Like

Posted 02 September 2014 - 12:43 PM

Writing a binary search once, I added the following comment:

 

// we've found what we were looking for (eat your heart out, Bono)

 

I guess you had to be there. biggrin.png


It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#63 Lactose!   GDNet+   -  Reputation: 3277

Like
0Likes
Like

Posted 02 September 2014 - 06:31 PM

I thought that was going to be a reference to the lyrics of Ben.

Ben, the two of us need look no more

We both found what we've been looking for

 

Which is not a reference I would have understood were it not for the amazing Whose Line Is It Anyway.



#64 Madolite   Members   -  Reputation: 205

Like
0Likes
Like

Posted 07 September 2014 - 07:46 AM

I saw a double rainbow once. But I didn't know what it meant. happy.png


Edited by Madolite, 07 September 2014 - 07:49 AM.


#65 JonathanLyons   Members   -  Reputation: 145

Like
0Likes
Like

Posted 24 September 2014 - 03:10 PM

 

The comment here is kinda funny
 

class Lens
{
public:
	virtual ~Lens();

	virtual Matrix4f GetProjectionMatrix() const = 0;
protected:
	Lens(float near, float far); 
	
	float mNear;
	float mFar;
	//float mWhereEeeeeevarYouAre;
private:
};

lol, i always leave these kinds of jokes in my code.

Too bad most of them won't be read by anyone...



#66 Sik_the_hedgehog   Crossbones+   -  Reputation: 1636

Like
4Likes
Like

Posted 25 September 2014 - 08:51 PM

// Possible values for boolean settings
static const ValidValues values_boolean[] = {
   { "1", 1 }, { "0", 0 },
   { "yes", 1 }, { "no", 0 },
   { "enable", 1 }, { "disable", 0 },
   { "enabled", 1 }, { "disabled", 0 },
   { "true", 1 }, { "false", 0 },
   // { "file_not_found", 2 },
   { NULL, 0 }
};

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.

#67 tanzanite7   Members   -  Reputation: 1245

Like
0Likes
Like

Posted 27 September 2014 - 03:06 AM

Nice reference you got there :)

 

spoiler: http://thedailywtf.com/Articles/What_Is_Truth_0x3f_.aspx



#68 Sik_the_hedgehog   Crossbones+   -  Reputation: 1636

Like
0Likes
Like

Posted 27 September 2014 - 07:29 PM

lol yep =D Though now considering uncommenting it and instead make the game react on the value in a funny way.

 

Also, if somebody wonders why there are so many variants in that list: this is part of an INI parser, and those INI files may be edited by people (not just programs), so I'm being forgiving here in case somebody writes a new setting. When the game itself writes to the file it always uses the yes/no pair.


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.

#69 sethhope   Members   -  Reputation: 388

Like
0Likes
Like

Posted 28 September 2014 - 11:35 PM

Personal favorite of mine (from the first version of my 2D engine back in 2009) 

	runRight = new ANIM();
	runLeft = new ANIM();
	runFront = new ANIM();
	runBack = new ANIM();
	idleRight = new ANIM();
	idleLeft = new ANIM();
	idleBack = new ANIM();//those of you with OCD will HATE me for these lines...
	idleFront = new ANIM();//if you don't have OCD, you have no idea what I'm talking about.

I develop to expand the universe.
"Live long and code strong!" - Delta_Echo (dream.in.code)

#70 tanzanite7   Members   -  Reputation: 1245

Like
3Likes
Like

Posted Yesterday, 07:32 AM

Personal favorite of mine (from the first version of my 2D engine back in 2009) 

	runRight  = new ANIM();
	runLeft   = new ANIM();
	runBack   = new ANIM();
	runFront  = new ANIM();
	idleRight = new ANIM();
	idleLeft  = new ANIM();
	idleBack  = new ANIM();//those of you with OCD will HATE me for these lines...
	idleFront = new ANIM();//if you don't have OCD, you have no idea what I'm talking about.

Fixed for you.

Edited by tanzanite7, Yesterday, 10:02 AM.


#71 sethhope   Members   -  Reputation: 388

Like
0Likes
Like

Posted Yesterday, 07:40 AM

 

Personal favorite of mine (from the first version of my 2D engine back in 2009) 

	runRight  = new ANIM();
	runLeft   = new ANIM();
	runFront  = new ANIM();
	runBack   = new ANIM();
	idleRight = new ANIM();
	idleLeft  = new ANIM();
	idleBack  = new ANIM();//those of you with OCD will HATE me for these lines...
	idleFront = new ANIM();//if you don't have OCD, you have no idea what I'm talking about.

Fixed for you.

 

You only fixed the formatting... There's more that should drive your OCD insane... Muahahahahaha!


I develop to expand the universe.
"Live long and code strong!" - Delta_Echo (dream.in.code)

#72 tanzanite7   Members   -  Reputation: 1245

Like
0Likes
Like

Posted Yesterday, 10:11 AM

You only fixed the formatting... There's more that should drive your OCD insane... Muahahahahaha!

Fine, refixificated.

What can i say, the formatting apparently irritated me so much that i had to fix it immediately and could not see the wood for the trees.

Obvious joking aside, there is actually some reasoning in addition to readability to actually keep that kind of stuff lined up. For example, in VS you can edit multiple lines at the same time (alt-select) - useful when you later need to change stuff.

... speaking of which, i take you wrote the "= new ANIM();" stuff per line (copy-paste or otherwise) instead of writing all of them at once? *hint-hint*

tongue.png

#73 sethhope   Members   -  Reputation: 388

Like
0Likes
Like

Posted Yesterday, 11:43 AM

 

You only fixed the formatting... There's more that should drive your OCD insane... Muahahahahaha!

Fine, refixificated.

What can i say, the formatting apparently irritated me so much that i had to fix it immediately and could not see the wood for the trees.

Obvious joking aside, there is actually some reasoning in addition to readability to actually keep that kind of stuff lined up. For example, in VS you can edit multiple lines at the same time (alt-select) - useful when you later need to change stuff.

... speaking of which, i take you wrote the "= new ANIM();" stuff per line (copy-paste or otherwise) instead of writing all of them at once? *hint-hint*

tongue.png

 

Yup. I am an oldschool programmer set in the ways of Borland and other such IDE's. I use the more modern ones, however, my practices haven't changed.


I develop to expand the universe.
"Live long and code strong!" - Delta_Echo (dream.in.code)





PARTNERS