public/protected/private is an unnecessary feature

13 points by jez


hyperpape

I’m willing to look dumb: there isn’t enough here for me to figure out why the article’s claims are true.

But other means could have been used, which reused the existing interface abilities of Simula. For example, Car could specify in the definition of Car that when Car is subclassed, only the fields declared in the base class Vehicle are available to the subclass.

Isn’t that morally an access modifier, very similar in effect to protected (albeit possibly not the same, because at least the java version of public/protected/package visible/private carves up the possibilities in a way that leave some combinations unexpressible: https://lobste.rs/c/4cszvr)?