3 ms·
Yes! What's wrong in the original article is that the the subclasses have inherited access to all the base classes' internals. There is no reason to allow tha
by peterashford 13y ago
Yes! What's wrong in the original article is that the the subclasses have inherited access to all the base classes' internals. There is no reason to allow that at all - the base class should hide it's implementation and allow subclasses to specialise via public methods. One could an interface for this if it was useful - which it would be for a library designer, for example.
- AnimalMuppet 13y agoExcept that you can't do that in JavaScript, which is the language the article is (directly) talking about. But he takes lessons from a language that has no access control to member variables, and tries to apply them to all OO languages. That's the problem with the article, IMHO.
- peterashford 13y agoYeah, I agree. I didn't make that clear and I should have.