News for hackers. Stuff that matters.
Re:The Repeated Deaths of OOP (2015) by rualca on Sunday June 06, 2021 @09:34AM (#27413038)
> The essence of OOP is not inheritance, that’s a nice to have. The essence of OOP is to encapsulate the data and the functions that operate on that data into an object and hide the internal state of the object from the rest of the program.

What is inheritance but a way to encapsulate data and methods in a way where you only need to override a subset of very specific methods and/or data to specialize an implementation?

Re:The Repeated Deaths of OOP (2015) by ratww on Sunday June 06, 2021 @12:45PM (#27414347)
Inheritance is a bit more complicated than that.

Your definition is closer to what the Template Method pattern [1] is, rather than inheritance in general.

Keep in mind also that neither inheritance itself nor the Template Method pattern guarantee encapsulation.

[1] https://en.wikipedia.org/wiki/Template_method_pattern