i have always been fascinated by coding and how the games i play work and want to work in that field when im older but don't know where to start i have tried learning unity but i just can't understand where do i start
This is a wild piece of optimization from Quake III Arena (1999):
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 fuck? y = * ( float * ) &i; y = y * ( threehalfs - ( x2 * y * y ) ); return y; }
Those are the actual comments. It calculates inverse square roots 4x faster than normal by treating float bits as an integer and using a "magic number" (0x5F3759DF). Nobody knew who wrote it for years, turned out to be Greg Walsh from the late 1980s.
Modern CPUs have dedicated instructions now, but this remains one of the most elegant low-level hacks ever written.
I know it may not be feasible so I'm reaching out to more experienced people for help, but are there any actual courses out there that would teach something like Python for instance from an almost reverse engineering perspective?
It might be an ADD thing, but every course for every language I've tried obviously begin with the fundamentals (duh), but those are things like "this built-in function allows you to find and print the length of this string" and my thought is "when the hell would I ever use that?". I really struggle to learn something when they provide you with all the basic tools but not give you any practical appliance of it. It's just not exciting, I can't learn that way. I get that you need to know what functions are, what methods are, etc. but every attempt to learn coding has gone this way and it's just irritating me.
I know this is more my fault than anything but I can't help it and want to try and find an alternative learning method.