3 ms·
> The problem is that this is completely divorced from anything that any sane person learning programming would want to do. It sounds to me a lot like a typica
by podperson 15y ago
> The problem is that this is completely divorced from anything that any sane person learning programming would want to do.
It sounds to me a lot like a typical game-programming kind of design question. Games are pretty popular. Can you think of a more generally popular problem domain?
Certainly, one can imagine very similar examples (car / vehicle / truck etc.) which would bear directly on very popular game analogies.
> So, for a tutorial aimed at teaching someone their 12th programming language, use birds/ducks.
I think your point here is well-taken. If the student knows about conventional programming, introducing OO coding is a different task than otherwise. But the whole 'print "quack"' point is pretty silly -- of course you'll initially teach about inheritance using trivial functionality that doesn't distract from the teaching point. I've seen OO tutorials that talk about point, square, and circle classes that never actually draw a point, square, or circle. Is printing "width = 100" more profound than "quack"?
In the end, you teach a topic by focusing on that topic, not adding a bunch of distracting detail. The distracting detail may be useful for motivation, but you need to get it out of the way to actually explain the point.
I might finally add that teaching a specific person you're talking to is a different task than writing a book. When you're teaching a specific person you can find out what they're interested in and use that as both motivation and example. But, if you're writing a book you want to find analogies that are are universally accessible and appealing as possible.