Hacker News new | past | comments | ask | show | jobs | submit login

    // Homework for today.  Write 2000 words reconciling "Your code must never crash" with "Intentionally putting crashes in the code".  Fucktard.
    //   DEBUG_CRASH(( "xferScienceVec - vector is not empty, but should be\n" ));
    //
https://github.com/electronicarts/CnC_Generals_Zero_Hour/blo...



  // Lets discuss how Windows is a flaming pile of poo. I'm now casting the header
  // directly into the structure, because its the one I want, and this is just how
  // its done. I hate Windows. - jkmcd
https://github.com/electronicarts/CnC_Generals_Zero_Hour/blo...


... because they just casted lParam into a pointer to DEV_BROADCAST_HDR a few lines above, which is the common part of the different structure it could point to. That's just doing inheritance the C way. What did they expect? A C++ class from a C api?


Generals was famously extremely rushed in development. Probably a novice programmer


This one made me laugh, mostly because the variable names are so dumb

// our RNG is basically shit -- horribly nonrandom at the start of the sequence.

// get a few values at random to get rid of the dreck.

// there's no mathematical basis for this, but empirically, it helps a lot.

UnsignedInt silly = GetGameLogicRandomSeed() % 7;

for (Int poo = 0; poo < silly; ++poo)

{

GameLogicRandomValue(0, 1); // ignore result

}


I spent some time browing curiosities about old games, and what strikes me is that the code sometimes was quite personal. You could see the joy, the anger, the disappointment, the satisfaction. Nowadays it would never fly to name a variable "poo", you need to stay professional at all times.


I was a game dev in the mid 90s. It was unserious. There was all sorts of crazy shit in the graphics assets. One wall I remember says "CUNT" on it o_O

I'm sad if developers can no longer name their variables poo and fuck.

Also teenage me would probably be horrified finding out 30 years later his source code was public.


> Also teenage me would probably be horrified finding out 30 years later his source code was public.

I guess that's why moral rights are unalienable in many countries: if you are horrified what they do with it, you still retain that and this right did not go to your employer

Not that I think there is anything here the devs need to be ashamed of, to be clear, just what came to mind as I read this remark


I'd just be horrified by the quality of some code. It included some of my best code, and some of my worst code. Some of it was written after three days straight with no sleep for those times when Eidos wanted to come for a personal demo.


> Nowadays it would never fly to name a variable "poo", you need to stay professional at all times.

I couldn't help but chuckle at your user name when reading this comment


Still today, I tend to increase my motivation of writing unit tests by using some non-serious names and strings in the tests.


Probably depends how indie/small your studio is.


Nowadays it just depends on how shitty your job is.


says who?


I recently had a PR rejected because I used the name of a fictional character from a 90's movie in my tests. Keep in mind the character itself was not controversial. The reason given was that it's not professional.

Tbf, I chalked it up to a one singular cantankerous reviewer rather than the whole company.


anal_reactor says so.


The person reviewing your PR.


open window, throw individual out >D


This is similar to "burn-in" for markov-chain montecarlo. When the chain is initialized to some bad value, it requires a number of iterations to get into a "good chain". But for a uniform RNG, any value should be good.

So the RNG doesn't seem great.


Well it works for RC4


Game code comments are always the most entertaining :D

https://en.wikipedia.org/wiki/Fast_inverse_square_root#Overv...


I don't get the complaint in the comment. Asserts for invariants/pre-/postconditions are absolutely compatible with not crashing: don't violate those properties.


As an ex-gamedev, this one cracked me up:

  else {
    DEBUG_CRASH(("PREFER_CORRECT_SOLUTION @todo impl"));
  }
(From PartitionSolver.cpp)


EA game devs cursing each other out? Internal company drama being aired out years later? Oh boy!


*Westwood


Generals was EA Pacific (Formally Westwood Pacific, opened by EA)




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: