Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a cautionary note about OOP #18

Open
chillenzer opened this issue Jun 2, 2023 · 3 comments
Open

Add a cautionary note about OOP #18

chillenzer opened this issue Jun 2, 2023 · 3 comments

Comments

@chillenzer
Copy link

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.

Likely related to #14.

@edbennett
Copy link
Member

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?

@chillenzer
Copy link
Author

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.)

@chillenzer
Copy link
Author

Oh, nice! Just stumbled across the "Squares" example in the Decorators chapter. That is a nice implementation to contrast with the inheritance-based version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants