21.04.2018, 02:43
Quote:
1) True, but only useful for data that needs sharing, and as a general rule, you should provide function accessors, not shared global state. This is true for any variable type.
2) True, but hardly a hardship - you can reset an enum in one simple expression (even though many people don't). And if your default values aren't '0', you still need reset code. 3) Structured data is a GOOD thing! Though vast 'PlayerInfo' structures aren't. 4) False, PVars take WAY more space. 5) See 3 for why the 'PlayerInfo' pattern is bad. 6) In other words, it hides errors in yiur code, instead of having the compile pick them up instantly to fix them. 7) I've written a whole multi-language text library and not needed them yet. Oh, and contrary to popular belief, they are VASTLY slower, not just a little bit. |