News for hackers. Stuff that matters.
Re:Ask HN: How often do you use inheritance? by foobarchu on Friday May 12, 2017 @09:20PM (#14329123)
Honestly, very rarely. Interfaces have been far more useful to me in my career, as far as major OO concepts go. If I'm extending, it's usually because someone brought in a new requirement after a products launch that requires very similar, but not quite the same, behavior as existing work. For example, we process data feed A already, and data feed B will be very similar. Rather than modifying the existing A processor, its often easier to lift out an abstract parent class and implement A and B as extensions of it. I almost never find myself extending concrete classes.

There are no comments on this comment yet.