Quote from Sciman on December 23, 2011, 10:00
1. Is Python a good language for kids to start with?
Is it ever. Python makes an excellent language for teaching (and it's an excellent language overall, to be honest). Why? Here's a few reasons :
- It's uncluttered by syntax, and consistent[1]. Other languages have curly brackets here, square brackets there, round brackets over here, semicolons all over the place, and even commas can get you in trouble.
- You get "instant feedback" through the REPL.
- It's a dynamic language - introspection and debugging are built in.
- It's not crippled. Unlike *cough* some other languages *cough* it doesn't restrict you to some "beginner[2] level" of what programming is. From if/then/else to continuations and tail call optimisations, it's pretty much all there.
Quote from Sciman on December 23, 2011, 10:00
2. Is it useful to teach OOP early?
It's a gnarly issue, this one. OO (or, at least OO as implemented by C++/Java and friends) has largely failed to meet a lot of the promises made early on - code reuse is
still largely restricted to "I will deliberately design a generic component" (a task that is particularly hard to do, and usually ends up with something as totally easy to understand as C++'s STL[3]). On the other hand, most languages have mixed up "classes" with "structures", and in place of making data structures and the functions that manipulate them, we instead largely make classes, and encapsulate the manipulator functions inside the class. I'd probably start by explaining user-defined structures, defining a few methods to create, destroy and manipulate, and then bring in the concept of encapsulating it all in a class. I probably wouldn't look at inheritance or polymorphism at the start.
To really teach OO, I would still suggest using smalltalk as the initial base language, then look at other possible implementations to see the pros and cons. Other implementations I'd look at include Python, Ruby, Javascript, CLOS and Self, and potentially some of the purely functional implementations of OO that have been done in scheme. It would, of course, be possible to build most of the latter in Python, but implementing a parasite OO system on an already OO language is a bit - well - wierd.
Quote from Sciman on December 23, 2011, 10:00
3. Speak like a programmer or like a generic human?
I'd suggest introducing the proper technical terms, but with an explanation in human terms. It's easier to "see", for example, a class as a cookie cutter than as a structure with a bunch of functions built in and addressed by a vtable. There comes a certain point where most concepts can be explained in terms of other technical terms, but the human aspect remains critical.
OO terminology can be a bit odd, but it was originally intended to be "human" (see Alan Kay's original smalltalk work). It's only really the explosion of pseudo-OO languages like C++ and Java with their bizarre terminology[4] that made a pig's arse of the whole thing.
Simon
[1] I'd also argue that scheme is at least consistent in its syntax, but r6rs introduces square brackets in certain cases. <sigh>
[2] Pronounced "moron"
[3] Or, alternatively, the mongolian language as pronounced by a drunkard with half a tongue.
[4] "private inheritance" for example. WTF?