3 ms·
Performance isn't the only reason to dislike Smalltalk-style message passing. A far more important one is the ability to actually reason about your programs (i.
by catnaroek 10y ago
Performance isn't the only reason to dislike Smalltalk-style message passing. A far more important one is the ability to actually reason about your programs (i.e., make inferences about what they will do when run, without actually having to run them), besides just testing objects as black boxes. Traditional imperative programmers can use Hoare triples and predicate transformers. Functional programmers can use any of the various semantic models that have been constructed for all sorts of lambda calculi. What on Earth does the poor object-oriented programmer who wants to understand his program have?
- Animats 10y agoObject invariants.
- catnaroek 10y agoMost interesting invariants span multiple data structures. For example, when you parallelize matrix multiplication, your invariant is product of the sequence of matrices, and what varies throughout the process is the length of the sequence. Presumably, for your sanity's sake, you want to consider each matrix a separate data structure.
- catnaroek 10y agoIn case you didn't understand the point to my first reply: Object invariants aren't powerful enough to describe how objects relate to one another, precisely because objects don't tell anything about their internal data structure to the rest of the world.