4 ms·
OOP goes bad when you take a centralized design and nominalize the verbs, yes. It's more fun to think in terms of trained animals: "Trash, go empty yourself out
by abecedarius 14y ago
OOP goes bad when you take a centralized design and nominalize the verbs, yes. It's more fun to think in terms of trained animals: "Trash, go empty yourself outside."
TrashBag >> emptyInto: vessel
|here| here := self place.
self go: vessel place.
vessel add: self spill.
self go: here
This seems just as reasonable as the English he wrote. (I like functional programming too.)
- russellallen 14y agoTrained animals is a good metaphor. Not passive objects acted upon but actors. Your example is even cleaner in Self which allows implicit 'self': emptyInto: vessel = (| here | here: place. go: vessel place. vessel add: spill. go: here )