3 ms·
> it's just a logical progression of categories of objects getting more specific as they branch out. That's the benefit of it. On a type abstraction level it's
by alkonaut 10y ago
> it's just a logical progression of categories of objects getting more specific as they branch out.
That's the benefit of it. On a type abstraction level it's perfect to write Organism > Animal > Dog. That's the benefit of inheritance. The drawbacks are more subtle though and manifest like mad stacktraces that are very brittle to change (what happens when I change what I return from this method? Who are the downstream and upstream users? What does this stacktrace mean? When it becomes difficult to reason about is when you have all these kinds of abstractions executing at the same time - which easily happens.
at Dog.CreateName
at Animal.CreateName
at Dog.SetNewName
at Animal.ResetName
at Animal.Create
at Organism.Create...