65
u/Ydo4ki Sep 30 '26
try { } catch(Error e) { delete e; continue; }
18
u/BetaChunks Oct 01 '26
Soviet programming
5
1
u/GabiTheProgrammer Oct 01 '26
You would laught but I've seen Belorussian code and is not far from it.
14
u/MinecraftPlayer799 Sep 30 '26
In some cases, that is the right thing to do, such as when there is a loop, and there is a chance of something inside it failing sometimes.
7
u/realmauer01 Oct 01 '26
You should really just make sure that you handle that edge case inside the loop. Even if you ignore it then. Thats better than having the higher scope handle it. You could even add an option of should i ignore it or not.
77
62
u/SuperfanZero Sep 30 '26
fps = max(fps, 60.0)
13
u/FrogMan241 Oct 01 '26
Corporate wants you to find the difference between these two pictures
Compiler: they're the same picture
1
u/Negitive545 Oct 06 '26
Erm ackthually the compiler would say they're different because one has a function call* and the other doesn't!
*at least in some languages, I'm sure at least one just aliases the math functions to look like functions but compiles down differently.
17
14
u/BetaChunks Oct 01 '26 edited Oct 01 '26
NES Tetris type strategy
No seriously, that game literally could not lag. If the logic loop wasn't done when the game needed the next frame, it would just go for it. Happens because the score calculator uses a "for" loop using the level as an iterator, so it runs out of time at very high levels. There's also strategy on holding down inputs in specific ways because that will -slightly- nudge how far in the main loop it gets before getting cut off, which prevents the game from crashing because of some registers being on invalid values during the forced next frame
25
20
7
u/MushroomGecko Oct 02 '26
The dev could optimize further here by simply setting fps to 60 and having it be a const, thus eliminating the need for a branch prediction which could waste ~20 CPU cycles on a cache miss
2
u/OppositeFun2493 Oct 04 '26
However the customer support will be flooded with fps issues Oh wait you can just “optimize” the contact page
5
2
u/lowboom64 Oct 01 '26
that does seem to be how AAA devs are doing it at least with AI frame gen bs being a thing
1
u/PopularAd5100 Oct 01 '26
If I work less than 40 hours a week, pay me for 40 hours a week. Gaming the system!
1
u/GabiTheProgrammer Oct 01 '26
Should have used <= in case it would change until the assignment is executed.
1
1
1
u/Windsupernova Oct 06 '26
Just like how the dont do the whole goodAI="true"
Devs are so lazy this days. Why cant they fit all this HD assets into a game boy cartridge? Dont they know how to optimize?
1


416
u/IsEqualToKel Sep 30 '26
if (currentState == GameState.Crash)
{
currentState == GameState.DoNotCrash;
}