3 ms·
On a tangent...a pervasive problem in programming language syntax is the confusion afforded by Class Access Modifiers (public, protected, private, et al), aka C
by Supermancho 4y ago
On a tangent...a pervasive problem in programming language syntax is the confusion afforded by Class Access Modifiers (public, protected, private, et al), aka CAMs.
In some languages, these are foremost used as mixin selectors (inheritance, traits, or other composition). They are commonly overloaded to describe the object's interface. I am not the only who to have seen objects inherit from other objects, with the derived class consisting of new CAMs to provide the proper interface (in lieu of some dedicated Interface class, like in Java). Then there's a third concern about testability and how to reach methods like private and protected.
If language syntax supported these different concerns with different mechanisms (notably Python and Go have made some headway for enabling testability) including a formal definition of an interface outside of CAM-mixin selection, it would make developer's lives a lot easier and quell many of the conflicting opinions about implementation dogma.