4 ms·
Pretty much all language features save for a shockingly small set are "unnecessary". The proper question is "are they useful?" The usefulness of public/protect
by rerdavies 1y ago
Pretty much all language features save for a shockingly small set are "unnecessary". The proper question is "are they useful?"
The usefulness of public/protected/private is that it provides a way to narrow the surface area through which derived classes can interact with their superclasses. Which is enormously useful from a maintenance perspective.
The place where inheritance is better than composition is where base classes provide partial implementations that are used by derived classes.
- mattkrause 1y agoExactly: "Loops are an unnecessary feature"