Hacker News new | ask | show | jobs
by guinness74 2164 days ago
Yes. The textbook examples really don't do practical applications justice though, e.g.:

  shape
  
  ...
  
  circle extends shape
I find it very useful to extend classes in an existing framework or system with a new functionality specific for my particular problem.

For a general example, sub-typing exceptions is useful.

1 comments

Yeap, same here. The last time when I actually created from scratch classes with inheritance was like 8 years ago. I never made this mistake again and used inheritance only when forced to by creators of some library.