3 ms·
> Who on Earth writes a Bike class? http://java.sun.com/docs/books/tutorial/java/concepts/inheritance.html http://java.sun.com/docs/books/tutorial/java/concept
by gdp 17y ago
> Who on Earth writes a Bike class?
http://java.sun.com/docs/books/tutorial/java/concepts/inheritance.html http://java.sun.com/docs/books/tutorial/java/concepts/inheri...
http://www.novio.be/blog/?p=621 http://www.novio.be/blog/?p=621
http://www.roseindia.net/software-tutorials/detail/9172 http://www.roseindia.net/software-tutorials/detail/9172
The 'Bike' is a very common example used in OOP texts, hence why it was included in this discussion. I agree that it's kinda terrible, but this is the common textbook way that OO is described.
- jobu 17y agoAs stated in other posts here, the problem isn't so much the 'bike' example as the 'real world' context. Try using the bike example in a game context. You have to map controller buttons to bike.turnLeft(), bike.brake(), etc. These generic examples make a whole lot more sense in a valid context.
- kragen 17y agoTerrible textbooks aren't evidence that object-orientation isn't a useful style. They're evidence that it's popular and not trivial to understand. That's evidence that it is useful. Your post is more evidence that it's popular (since you're bothering to write about it even though you don't like it) and not trivial to understand (since you didn't bother to mention any of the important aspects of it).