Timeline for Why is my class worse than the hierarchy of classes in the book (beginner OOP)?
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 7, 2012 at 1:16 | comment | added | Evan Plaice | +1 Nice thorough breakdown. The comment, "That's more complexity with no added benefit" illustrates the concept of 'opportunity cost' in programming perfectly. Theory != Practicality. | |
| Apr 5, 2012 at 14:46 | comment | added | Karl Bielefeldt | I agree with you in general. However, educational examples are often contrived and over-architected in order to illustrate a point. You ignore other considerations for a moment in order not to confuse the issue at hand, and introduce those considerations later. | |
| Apr 5, 2012 at 12:15 | comment | added | Michael K | In this case, yes, it's too much complexity. But in a larger system, you will be adding more lessons, like SemesterLesson, MasterOneWeekLesson, etc. An abstract root class, or better yet an interface, is definitely the way to go then. But when you have only two cases, it's up to the discretion of the author. | |
| Apr 5, 2012 at 12:12 | history | edited | Michael K | CC BY-SA 3.0 | deleted 3 characters in body |
| Apr 5, 2012 at 12:03 | history | edited | Simon Bergot | CC BY-SA 3.0 | fixed typo |
| Apr 5, 2012 at 11:35 | history | answered | Simon Bergot | CC BY-SA 3.0 |