Comment

Comment by gregkerzhner

I feel like the real Liskov Subsitution Principle should be "if you have a subtype P of type S, redesign your code so that there are no subtypes".

Seriously though, I have been a professional developer in a classical object oriented language for the last 5 years and have written 0 class hiarchies. Common functionality can be mixed in by composing "parent" objects around common child objects. Passing multiple types of objects to a single function is better handled via interfaces, not inheritance.

Is there a good reason to have a class hierarchy in modern programming?

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton