|
|
|
|
|
by lmm
1970 days ago
|
|
In an OO program all state is global, because you can't understand any given object's behaviour without knowing what its state is and what the behaviours of all the objects it communicates with are, and you can't understand those without knowing their states either. State can and should be hierarchical - and you can do that easily in FP - but the idea that OO lets you make it somehow non-global is a myth. |
|
By that logic all state in any program is global.
But if I'm writing an MMO server my GoldCoin class doesn't need to know about the client's connection state.
Have you actually written or worked with OO code before? Your comment reads like you have not.