22 Aug 2011 09:37
Goodbye, shitty Car extends Vehicle object-orientation tutorial
Kragen Javier Sitaker <kragen <at> canonical.org>
2011-08-22 07:37:02 GMT
2011-08-22 07:37:02 GMT
I propose a new rule for discussions of object-oriented programming: > **Anyone who brings up examples of Dog, Bike, Car, Person, > or other real-world objects, unless they are talking about writing a > clone of The Sims or something, is immediately shot**. I feel that this new policy will improve the quality of the discourse enormously. [Henning Koch wrote][] about his encounter with dependency injection: > Aside from having snorted coke through my nose over “nearly > tautologic diagrams” I feel the need to defend Martin Fowler’s > [article][Fowler] because it had such a profound effect on me when > it was published. Although I had been playing with “objects” and > “classes” before, this article finally made me understand what OOP > was all about. This is not true for many other articles and yes, I’m > looking at you, shitty `Car extends Vehicle` OOP tutorial. [Henning Koch wrote]: http://www.netalive.org/swsu/archives/2005/10/in_defense_of_the_nearly_tautologic_diagram_1.html (Henning Koch, posted on blog “Software will Save Us”, 2005-10-13, “In defense of the nearly tautologic diagram”) [Fowler]: http://martinfowler.com/articles/injection.html (Inversion of Control Containers and the Dependency Injection pattern, by Martin Fowler, 2004-01-23) Why `Car extends Vehicle` or `Duck extends Bird` are terrible examples. ----------------------------------------------------------------------- The `Car extends Vehicle` or `Duck extends Bird` type of tutorial obscures more than it illuminates. In good OO programming, we don’t(Continue reading)
RSS Feed