2 ms·
https://yourlogicalfallacyis.com/middle-ground https://yourlogicalfallacyis.com/middle-ground The alternative he presented is not to share private state betwee
by jonahx 13y ago
https://yourlogicalfallacyis.com/middle-ground https://yourlogicalfallacyis.com/middle-ground
The alternative he presented is not to share private state between class and superclass. This really isn't a "know the right tool for the right situation" kind of thing -- it's almost never a good thing.
You could accomplish this alternative, among other ways, by:
1. Using composition and delegation.
2. Using mixins, if your language supports them.
3. Using inheritance, but depending only upon your superclass's public interface.