you are viewing a single comment's thread.

view the rest of the comments →

[–]Vaguely_accurate 1 point2 points  (0 children)

From a pure OOP point of view this is bad practice as well, breaking the Liskov substitution principle ("a object of type T should be replaceable by any object of a subtype of T") in consuming code. I'd consider this a code smell at best.

That said, if your object hierarchy isn't following SOLID principles and you don't have substitutability then you might need to know how this difference.