It might be nice to use in some very specific cases (e.g. addition-operation is a binary-operation AST node which is an AST node).
In most of the cases it just creates noise though, and you can usually do something different anyway to implement the same feature. For example in rust, just use enums and list all the possible cases and it’s even nicer to use than inheritance.
In over ten years of professional programming, I have never used inheritance without regretting it.
When it’s the right tool, it’s incredibly useful. When it’s the wrong tool, and it often is, it racks up tech debt at an incredible rate.
It might be nice to use in some very specific cases (e.g. addition-operation is a binary-operation AST node which is an AST node).
In most of the cases it just creates noise though, and you can usually do something different anyway to implement the same feature. For example in rust, just use enums and list all the possible cases and it’s even nicer to use than inheritance.
It works great for technical constructs. E.g. A Button is a UI element. But for anything business logic related, yeah it’ll suck.
And not once have I regretted removing inheritance.
That’s wild. What did you use it for?