So I found out there was a decompilation project for Harvest Moon 64 and whoever programmed the original game loved nested if/switch statements because there is a ton. Granted, the game is programmed in C, and I'm used to OOP, but I don't understand why they couldn't just use data tables and function pointers. It's almost as if YandereDev wrote this.
https://github.com/harvestwhisperer/hm64-decomp/blob/master/src/tv.c
@xianc78 i used way too many in my game lol, could have lessened it by a lot if i knew more about general coding practices instead of just making things work in rpg maker. no way am i going back and changing all of it now lol but some of the systems are a bit of a mess xD
@xianc78 @beardalaxy Calculation is what CPUs do best. Jumping across code memory in a way that makes it hard for the compiler, the cache, and CPU to optimise around however isn't
@xianc78 @beardalaxy Knowing what is going to be faster with todays hypercomplex hardware is a guessing game at best
In either case, it's the wrong point to make. Write sane, readable, maintainable code first. Optimise then only later if it is clear there is a reason to. The compiler will usually do a better job of it anyway