3 ms·
> The only time I’ve used inheritance, has been on toy problems that didn’t need it See https://news.ycombinator.com/item?id=39999644 https://news.ycombinator.
by gwbas1c 3y ago
> The only time I’ve used inheritance, has been on toy problems that didn’t need it
See https://news.ycombinator.com/item?id=39999644 https://news.ycombinator.com/item?id=39999644
It's very useful when a base class provides an incomplete implementation, and the child class completes the implementation.
Sometimes I use it when testing, where the child class alters some behavior in a way that mocking can't do correctly.
In C# / Java, inheritance is used for setting up filters for exceptions