3 ms·
I stopped reading as soon as I saw the shape class. This example (along with the proverbial animal) has done a lot of harm to OOP and programming. You need ba
by bluGill 3mo ago
I stopped reading as soon as I saw the shape class. This example (along with the proverbial animal) has done a lot of harm to OOP and programming. You need base classes (which are not always the right answer, but when they are) to be based on the abstract concept you need to model not something real that is easy to understand when someone isn't an expert in your domain.
- mrkeen 3mo agoMaybe give shape another try. https://www.youtube.com/watch?v=zHiWqnTWsn4 https://www.youtube.com/watch?v=zHiWqnTWsn4 1:00:00 - Open/closed principle and 1:13:52 - Liskov substitution principle. Both are given in terms of Shape, but it's to paint the picture that things are more complicated than you thought, even with something that should have been as simple as shapes. (As opposed to "shapes are easy, just model the world like that and it will be easy too")
- bluGill 3mo agoI won't have time to watch that anytime soon, but your summary makes my point. The real world is complex and shape as a quick skim shows this article used is just a bad example. Worse they were using this bad example to try to make a general point but the example used was to simple to generalize like that.