4 ms·
You can't really separate a taxonomy of a system from your desire to make statements about specific things. So your ability to use OOP effectively depends on yo
by jschwartzi 6y ago
You can't really separate a taxonomy of a system from your desire to make statements about specific things. So your ability to use OOP effectively depends on your ability to decide whether the statements you're allowing yourself to make about your types are the kinds of statements you consider meaningful.
One could easily change the taxonomy from "wheel" and "brake pad" to "spinning surface" and "stopping surface." And if you want to construct a bicycle by composition, you know that in order to implement brake() you need two items which implement SpinningSurface and StoppingSurface. The SpinningSurface could easily be of type WheelRim, but it could also be of type BrakeDisc. And in both cases the StoppingSurface is of type BrakePad with the difference in how BrakePad is applied to SpinningSurface.
And with this taxonomy you could also allow users to use Shoes, WaterBottles, Wrenches, and a whole host of other objects as StoppingSurfaces.
So the problem isn't with trying to encode anything with types, the problem is that people try to encode everything with types. You have to pick your battles, and you have to devise your taxonomy such that you can make meaningful abstractions. That remains an art form.
- taeric 6y agoIndeed, I typed "anything with types", but I really meant in a total sense. Such that I did mean "everything with (one set of) types." I tried to make it clear that I do find high level taxonomies nice. Just the further you zoom in, the less useful a strict adherence to that will be.