News for hackers. Stuff that matters.
Re:Inheritance Is Terrible by mjevans on Saturday March 19, 2016 @04:53PM (#11320402)
This would have made more sense if the inheritance were different.

Item (a thing that is sold at a final price and which goes in to a shipping container (has physical size / weight data)).

Book (a type of Item) which has a price that decomposes in to various costs...

BD_Movie (a different type of Item) which has other features that decompose differently from other Items.

Though an argument could also be made for simply having a generic ShippableItem object which has extra key-value tags in that same application.

Maybe the issue isn't that the ability to use Inheritance is terrible but that the particular design choice of doing so turned out to be a poor fit for expressing the business needs.

Re:Inheritance Is Terrible by Gibbon1 on Sunday March 20, 2016 @03:20AM (#11322124)
My eyes start bleeding when I think too hard about this, but seems in my world inheritance in these cases is being used as a really bad substitute for properties. Which is a lot of 'things' have flat collections of properties not a hierarchy of properties.

I suspect this is why LINQ kinda popular. No one cares if book inherits item. They want to query the random collection of crap someone ordered for 'is a book' or is 'food' so they can properly calculate the sales tax in Minnesota.