Laughable code comment of the day

Other talk that doesn't fit elsewhere.
This is for General Discussion, not General chat.
Lord Apocalypse
Regular
Regular
Posts: 678
Joined: 29 Jul 2009, 18:01

Laughable code comment of the day

Post by Lord Apocalypse »

We've got a nice thread like this over on the VS forums and I've found a few in the WZ retail source.. Will have to check the current master code to see if any are in there hiding.... but, do enjoy and get a kick out of what developers leave lying about in the games code from time to time. I'm sure with enough digging there are gems in a great many open source games or open sourced commercial games ;)
// IHATESCRIPTSANDEVERYTHINGTHEYSTANDFOR(ESPECIALLYONSUNDAYS)
// ffs - jeremy if you touch psx only code again, I will break your legs
followed by...
// Jeremy ... the usual leg breaking rule aplies if you remove this again
and then there's...
// If it's already loaded then we shouldn't really re-load it ... but what the frack it's saturday
sub frack for famous f word for actual quote.

And a few from Vega Strike that some may find amusing :)
//In short I have NO CLUE how this works! It just...grudgingly does
//You died or something... too bad.
Lord Apocalypse
Regular
Regular
Posts: 678
Joined: 29 Jul 2009, 18:01

Re: Laughable code comment of the day

Post by Lord Apocalypse »

Another snippet
//#ifdef PSX
// // Something in this function may be causeing a crash....
//#warning HMMMMMMM.... THIS FUNCTION APPEARS TO CAUSE A CRASH.... MUST FIX....
// return;
//#endif
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: Laughable code comment of the day

Post by Per »

See http://developer.wz2100.net/wiki/FunQuotes

Feel free to add to it.
Lord Apocalypse
Regular
Regular
Posts: 678
Joined: 29 Jul 2009, 18:01

Re: Laughable code comment of the day

Post by Lord Apocalypse »

... well I added this one to the page
// GODDAM *#!! LOWERCASE assert IS ABSOLUTELY NO %^$## USE ON THE PC
// assert(2+2==5);
edit for language if need be.
User avatar
Stratadrake
Trained
Trained
Posts: 197
Joined: 07 Sep 2008, 09:43
Location: Pacific NW

Re: Laughable code comment of the day

Post by Stratadrake »

http://en.wikipedia.org/wiki/Fast_inverse_square_root:

Code: Select all

float Q_rsqrt( float number )
{
        long i;
        float x2, y;
        const float threehalfs = 1.5F;
 
        x2 = number * 0.5F;
        y  = number;
        i  = * ( long * ) &y;                       // evil floating point bit level hacking
        i  = 0x5f3759df - ( i >> 1 );               // what the f**k?
        y  = * ( float * ) &i;
        y  = y * ( threehalfs - ( x2 * y * y ) );   // 1st iteration
//      y  = y * ( threehalfs - ( x2 * y * y ) );   // 2nd iteration, this can be removed
 
        return y;
}
"W.T.F." is exactly why they call it a "magic number".
Strata @dA, @FAC