3 ms·
The article completely misses the point because it sets up a large amount of straw men that are completely unrelated to the point The fact that "Car extends Ve
by hota_mazi 7y ago
The article completely misses the point because it sets up a large amount of straw men that are completely unrelated to the point
The fact that "Car extends Vehicle" is sometimes a subpar modelization has nothing to do with OOP or inheritance and everything to do with the fact that the English language is not specific enough to describe what a Vehicle is well.
Same goes with "Duck extends Bird". Yes, there are a few birds that don't fly. This problem has nothing to do with programming languages, inheritance, or OOP.
I still find these two examples, "Duck extends Bird" and "Car extends Vehicle" as extremely powerful to teach beginners what OOP is about.
Like all metaphors, they tend to leak if you push them too far, but they do a splendid job at introducing beginners to the concept of OOP, which is going to serve them well for probably most of their professional life.