3 ms·
This is what objects were supposed to be for. When you have some consistency requirement between some variables, you make them private to an object and only exp
by Animats 10y ago
This is what objects were supposed to be for. When you have some consistency requirement between some variables, you make them private to an object and only export methods which maintain that consistency requirement.
Somehow this seems to have been lost.
- dmytrish 10y agoObjects coupled with formal proofs, maybe. Otherwise, nothing has been lost: naïve approach to objects seems to work well for managing memory and garbage collection, otherwise it's just a bothering implementation detail of a language runtime, that does not help a programmer much and is itself a liability. Objects do dynamic checks at runtime, whereas types are known (and verified) before a program is executed.
- mannykannot 10y agoThat is a good idea as far as it goes, but it does not go far enough. Soon enough you will find a consistency requirement that does not fit into any structure that works for other consistency requirements (other than the degenerate God object antipattern, which defeats the purpose) - and consistency is only the first step to being correct, anyway.