Revision of OOP#164
Conversation
major revison of the OOP chapter and moving the content from GUI to its own chapter
JakobKlotz
left a comment
There was a problem hiding this comment.
Great cohesive chapter to solidify the students' understanding of the language itself and help us for consecutive courses like Data Science!
Like the info box at the end, brings it all together. Plus I never knew about class attributes, guess I'll have to put them to use in one of my projects. 😄
| healer.heal(hero) | ||
| hero.show_health() | ||
| ``` | ||
| In the last step, we create an enemy called Bowser from the `GameCharacter` class, a hero called Mario from the `Hero` class, and a healer called Toad from the `Healer` class. |
There was a problem hiding this comment.
Since inheritance is such an abstract concept for students, maybe we could emphasize "the power of inheritance" again, after students saw your examples. You've already stated it at the top of the section, but it could be a nice addition.
???+ tip
Think of the base class `GameCharacter` as the shared template for all
characters. The child classes `Hero` and `Healer` inherit everything from
this template (the name, health, and show_health() method), but then add
their own specialized features on top of it.
This way, you write the common code only once and reuse it everywhere!
What do you think? 😄
Co-authored-by: Jakob Klotz <jakob.klotz@mci.edu>
Co-authored-by: Jakob Klotz <jakob.klotz@mci.edu>
Co-authored-by: Jakob Klotz <jakob.klotz@mci.edu>
Included the tip to clarify inheritance concepts - thx for the suggestion :)
|
Thank you for the fast review and thoughtful response! I really appreciate the suggestions you made to make the code more readable and to nicely sum up the inheritance chapter, I think they greatly improve the overall understanding of the topic 😄 From my side, I’m very happy with the changes and ready to close the pull request. Thanks again! |
Major revision of the OOP chapter and moving the content from GUI to its own chapter.
Looking forward to your feedback - thx for checking :)