No. Only some people who are really opinionated might say that else
is bad. But “if-else” structures are really a core part of imperative programming.
Not knowing switch statements, it is a bad thing. Long chains of if-else are hard to understand, and as such are considered bad style. Instead switch statements should be used.
I think you’ve missed some important parts of the discussion around that. I’ve seen a video where someone recompiles the YandereSim game in Unity and runs it, and basically gets vastly improved framerate by cutting down on the useless checking of “is it time to do x in my schedule yet” all the objects constantly do.
Unless you take part in a challenge to specifically avoid if statements, you will use them in a game. There’s no good reason not to. This whole question is something only a beginner without any programming experience would ask.
This would be fine, and actually understandable if the values are written in a certain order like, is the age over 25, is the age over 15, is the age over 10, else do something different. Many programming languages don’t support switch cases to be value ranges. For those you literally just have to do such a chain of conditions. The only option would be to do an early return, but that isn’t better in all cases (and of course there are again people who are really against early returns, I’m personally in favour of them in many cases).
If you actually need to do different actions on different value ranges, you just have two options: put the checks in the most understandable order (like I mentioned above), or redesign the game to not have that kind of value range based conditions.
Coming back to that performance problem, what YandereDev should have done is some kind of event pattern where either the game entities are given the game time like once every few seconds (whenever the simulated in game time changes), or a more complex system where game entities register to listen to specific events like “previous class ended” and only then reacting to that.
If you have just one thing checking a list of 50 items to see if it is time to execute any of the actions yet for each frame of the game, that’s not too bad. But then when you need to duplicate that object 50 to 100 times. Suddenly you have an exponential growth of the needed code that has to run each frame.
I’m not sure why I bothered to write this long of a post, as only people who have grasped programming at least at a beginner level will be able to fully appreciate…