You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Code design based heavily on inheritance has become a bit unfashionable over the years. One of its pitfalls is that code-wise sensible abstractions are not necessarily related to real-world ones. Examples: Is a Square a special case (translating to child class) of a Rectangle or the other way round? Is a Penguin a Bird or a Fish? I would suggest that we add a challenge (or even a section) about this at the end of the inheritance chapter.
We also try and touch on this in the final episode; do you think this could be included in that discussion, or does it want a separate mention earlier in the lesson?
I'm not there yet. Update once I've read it. (Sorry, I've checked the chapter titles and from that it wasn't obvious that it would appear again later.)
Oh, nice! Just stumbled across the "Squares" example in the Decorators chapter. That is a nice implementation to contrast with the inheritance-based version.
Code design based heavily on inheritance has become a bit unfashionable over the years. One of its pitfalls is that code-wise sensible abstractions are not necessarily related to real-world ones. Examples: Is a
Square
a special case (translating to child class) of aRectangle
or the other way round? Is aPenguin
aBird
or aFish
? I would suggest that we add a challenge (or even a section) about this at the end of the inheritance chapter.Likely related to #14.
The text was updated successfully, but these errors were encountered: