4 ms·
What I mean is that there's a lot more custom types in real world code, and custom types aren't gonna be something you're already familiar with when reading new
by nv-vn 7y ago
What I mean is that there's a lot more custom types in real world code, and custom types aren't gonna be something you're already familiar with when reading new code.
Complex inheritance chains come into this because it makes it hard to track down the code you're looking for. Like let's say we have Cat : Feline & Pet, Feline : Mammal, Mammal : Animal, Pet : Property, Animal : Alive. Now when I do cat.eat(x) it's impossible to predict where eat is defined. Knowing that it's a Cat didn't make it any easier to understand the implementation of eat.
- pvg 7y agoI know what complex inheritance chains are, I'm still not sure how they have much to do with this article. Your comment to me reads like you're trying to forklift a generic critique of OOP on top of this rather slender, content-wise, post. There's not enough in the post to support it and the generic critique is still, well, generic.
- nv-vn 7y agoOOP is a part of it, but what I'm trying to get across is that knowing the type of a variable doesn't make the code substantially easier to comprehend. In small examples it might, but as code scales up abstractions are much more confusing than lack of type annotations. Specifically, complex types can hide important type information far better than type inference.