My game is praised for being "very stable for an Early Access title".
It's not because i'm a better game dev.
It's because I do not use "Defensive Programming".
I write below why it's bad for WIP/Early-Access games and when it makes sense to use it.
It's not because i'm a better game dev.
It's because I do not use "Defensive Programming".
I write below why it's bad for WIP/Early-Access games and when it makes sense to use it.
Comments
it doesn't matter if you think the code is more elegant or "right" this way, it's not a college assignment, it's a game
we want it to break when things go wrong, we need to know about those things!
It's a form of defensive design intended to develop programs that are capable of detecting potential security abnormalities and make predetermined responses. It ensures the continuing function of a piece of software under unforeseen circumstances.
You code lots of checks so the game/software doesn't crash when actually an error happened.
This causes:
1) Code getting super bloated
2) Errors and bugs staying undetected. Why? The game still runs. So players and testers often do not notice that something went wrong.
It's forced me to fix those things, but I have to have faith I can catch enough to stop it being easy to break
I like your approach!
You can still decide for release to add some fallback. But i personally wouldn't but rather wait for the bug reports. And add specific fallbacks in case it's more random stuff like users PC setup/no RAM/whatever.
But this way i ensure the bugs get reported and i can actually fix them for the full release. They don't stay undetected.
For software which is not allowed to crash at any point. Like planes or medical devices. You do not want them to crash but read out the error log later.
1) Servers. We dont want that server crashing.
2) Full Release. Not Early Access or test phase. To avoid crashes but accepting potentially undetected in-game buggy behaviour.
Or extensive null checks for stuff which shouldnt actually be null when the game runs correct.
We want that Exceptions happening to notice bugs and not catch them and move on.