3 ms·
The main problem which global state introduces, is making the bad assumption that there will only be one example of a given sort of data. In games, that's a sa
by samatman 6y ago
The main problem which global state introduces, is making the bad assumption that there will only be one example of a given sort of data.
In games, that's a safe assumption for many parts of the system, since you're definitely only going to be running one instance of the game world at a time. So making that state private just means you have to pass around references to it on the stack, and keep track of what you're doing.