If you follow the "Tell, Don't Ask" style, objects have very little visible state to assert about.
...
When writing a program, I care only about what that program does, not the internal state that the program uses to control what it does. The only visible behaviour that a program has is its interactions with external entities
...
Mutable state makes a program harder to understand and maintain
...
"Doing encapsulation right is a commitment not just to abstraction of state, but to eliminate state oriented metaphors from programming." — Alan Kay
Read the full post:
http://nat.truemesh.com/archives/000342.html
Print | posted @ mercoledì 18 agosto 2010 17:34