Computers for children
2007-09-30 21:28I've been thinking about teaching children to program (or helping them to learn), especially since it came up in conversation at a recent party. (This is slightly inspired by my son, but he's only a year old so he won't be getting to grips with computers for some years yet.) The discussion at the party was based on our experience of starting with 1980s micros, which we think was a good way to learn programming, so how could we provide something similar to the children of today? I think this kind of micro must be:
* safe for playing with minimal supervision
* very simple (or apparently so)
* good for fun as well as for programming
More detailed requirements are a consequence of the above:
* The hardware has to be robust, so no moving parts. The drivers have to be robust too, so you can yank the power or plug/unplug peripherals without bad consequences.
* As cheap as possible, so it doesn't matter if it dies from abuse. This implies it should be off-the-shelf, and able to use standard peripherals, e.g. hand-me-down display etc.
* No high-level networking. Low level features are useful for older children to learn network programming, but for most usage it'll have an air gap for safety.
* No complicated user interface. It'll run one full-screen task at a time, such as a game or a programmer's read/eval/print loop.
* Easy to do fun things with graphics, sounds, and robotics.
I think the right solution is to use a "thin client": one of those computers that's designed to provide a keyboard and display to a remote server. You can get plausible ones for about £100. However, instead of booting off the net, it must be able to boot off flash (built-in or USB). At the moment a couple of good options are the TinyTuxBox 4 or the Linutop, both based on the same AMD Geode CPU, though the latter has the advantage of using LinuxBIOS.
It might not be easy or sensible to reflash the BIOS so that these computers can boot straight into BASIC for that authentic 1980s experience, so it's probably best to use USB flash drives as if they were Atari or Nintendo cartridges. Then it should be easy to ship software as disk images - with perhaps collections of games for fun as well as a programming language.
I'm not actually keen on BASIC as a language or environment. Its only surviving descendent is Visual BASIC which is too complicated, volatile, and proprietary for my purposes, and I don't see any advantage in resurrecting an older variant. Logo has plenty of teaching materials, which is handy, and it's a reasonably nice language with a fair amount of power. Or maybe Lua - though perhaps that only seems simple to people who already know how to program. I think it's also worth providing a text editor for programming, not just a command prompt, since we aren't constrained by memory in the way the eight-bits were, and the children will already have some familiarity with word processors.
Under the simple language and simple editor, it is unfortunately difficult to remain simple without expending a great deal of effort. It's a challenge just to get a modern CPU to run without toasting itself to a cinder. On the x86 platform you have 25 years of accumulated expedient hacks to work around in software. Doing general-purpose IO over USB is just a bit more complicated than a latch wired to your data bus. Given all that it seems that the most sensible plan is to start with a Linux or BSD kernel, and put a simplified userland on top.
It's difficult to choose how to support the key features - graphics for example. X11 is not simple, but it is very well supported and it's easy to make it look simple (if you throw away the display manager and window manager etc.) On the other hand it ought to be simple to build on top of the framebuffer device, but then (since I don't want to re-invent many wheels) I'd still end up pulling in layers of complexity (DirectFB and associated libraries) some of which are explicitly experimental and incomplete. But since it's all sitting on a Unix kernel I suppose I've already given up the idea of making its innards easily comprehensible.
Another example of the appearance of simplicity despite enormous amounts of hidden complexity has to be robotics. Phidgets look like fun hardware interfaces, but of course they depend on USB so they only appear to be simple...
Before signing off I should note that the OLPC XO is not what I'm after. It has more user interface and more networking than I want. I don't want a general-purpose computer, I want a programmable toy.
* safe for playing with minimal supervision
* very simple (or apparently so)
* good for fun as well as for programming
More detailed requirements are a consequence of the above:
* The hardware has to be robust, so no moving parts. The drivers have to be robust too, so you can yank the power or plug/unplug peripherals without bad consequences.
* As cheap as possible, so it doesn't matter if it dies from abuse. This implies it should be off-the-shelf, and able to use standard peripherals, e.g. hand-me-down display etc.
* No high-level networking. Low level features are useful for older children to learn network programming, but for most usage it'll have an air gap for safety.
* No complicated user interface. It'll run one full-screen task at a time, such as a game or a programmer's read/eval/print loop.
* Easy to do fun things with graphics, sounds, and robotics.
I think the right solution is to use a "thin client": one of those computers that's designed to provide a keyboard and display to a remote server. You can get plausible ones for about £100. However, instead of booting off the net, it must be able to boot off flash (built-in or USB). At the moment a couple of good options are the TinyTuxBox 4 or the Linutop, both based on the same AMD Geode CPU, though the latter has the advantage of using LinuxBIOS.
It might not be easy or sensible to reflash the BIOS so that these computers can boot straight into BASIC for that authentic 1980s experience, so it's probably best to use USB flash drives as if they were Atari or Nintendo cartridges. Then it should be easy to ship software as disk images - with perhaps collections of games for fun as well as a programming language.
I'm not actually keen on BASIC as a language or environment. Its only surviving descendent is Visual BASIC which is too complicated, volatile, and proprietary for my purposes, and I don't see any advantage in resurrecting an older variant. Logo has plenty of teaching materials, which is handy, and it's a reasonably nice language with a fair amount of power. Or maybe Lua - though perhaps that only seems simple to people who already know how to program. I think it's also worth providing a text editor for programming, not just a command prompt, since we aren't constrained by memory in the way the eight-bits were, and the children will already have some familiarity with word processors.
Under the simple language and simple editor, it is unfortunately difficult to remain simple without expending a great deal of effort. It's a challenge just to get a modern CPU to run without toasting itself to a cinder. On the x86 platform you have 25 years of accumulated expedient hacks to work around in software. Doing general-purpose IO over USB is just a bit more complicated than a latch wired to your data bus. Given all that it seems that the most sensible plan is to start with a Linux or BSD kernel, and put a simplified userland on top.
It's difficult to choose how to support the key features - graphics for example. X11 is not simple, but it is very well supported and it's easy to make it look simple (if you throw away the display manager and window manager etc.) On the other hand it ought to be simple to build on top of the framebuffer device, but then (since I don't want to re-invent many wheels) I'd still end up pulling in layers of complexity (DirectFB and associated libraries) some of which are explicitly experimental and incomplete. But since it's all sitting on a Unix kernel I suppose I've already given up the idea of making its innards easily comprehensible.
Another example of the appearance of simplicity despite enormous amounts of hidden complexity has to be robotics. Phidgets look like fun hardware interfaces, but of course they depend on USB so they only appear to be simple...
Before signing off I should note that the OLPC XO is not what I'm after. It has more user interface and more networking than I want. I don't want a general-purpose computer, I want a programmable toy.
no subject
Date: 2007-09-30 22:31 (UTC)Aren't you missing a trick, here, though? It's now so easy, again, to build computers, just like it was in the early days! And the possibility of a machine with an open "ROM" and hardware, how wonderful that would be!
no subject
Date: 2007-09-30 22:41 (UTC)Why not an OLPC XO? It has more things than you want, but surely that's much better than fewer, given you can fairly easily disable stuff? It's also cheap and rugged.
Another possibility might be Lego Mindstorms? Or an old BBC micro with the Logo ROM inserted higher than BASIC?
How easy would LISP be to learn? It goes against the grain of a lot of more recent syntax, but that's not necessarily a problem if it's the first language someone encounters.
Or you could try Alligator Eggs, though it feels a bit contrived to me, and not actually as easy to understand as lambda calculus.
no subject
Date: 2007-09-30 22:48 (UTC)I don't want to make a computer from scratch because it would not be sufficiently robust or cheap. Something based on off-the-shelf hardware is more likely to be of use to other people.
no subject
Date: 2007-09-30 22:51 (UTC)And conversely, I think it's definitely worth providing a command prompt, not just a text editor!
The thing I always thought was really good about BASIC was the interactive command-by-command mode, which enabled lots of hands-on playing with the capabilities of the system before you started organising your commands into list form. Lots of round-trips during one's interaction with the machine allow you to get lots of information: typing in a twenty-line program, hitting Run and getting a single piece of information back about whether it worked or not isn't nearly as illuminating as trying several of those lines one at a time in rapid succession and then stitching them together into a program.
So this was a big plus point of BASIC as a teaching language over, say, Pascal; if it were me choosing a teaching language now I'd probably make that a major criterion in my choice.
no subject
Date: 2007-09-30 22:58 (UTC)Lego Mindstorms makes a plausible peripheral, but it's a satellite to a bigger computer. A good alternative to the Phidgets, I think.
An old BBC doesn't have any sensible storage options.
Lisp is just Logo with more (). Alligator Eggs is a game, not a programming language.
no subject
Date: 2007-09-30 23:03 (UTC)An interesting question: what would you use to teach someone programming?
no subject
Date: 2007-09-30 23:16 (UTC)The BBC Master had a text editor in ROM. You could switch from the command prompt to the editor with *EDIT, and it would present you with the current program to mangle as you wished, and it would be re-tokenized by BASIC when you exited. I'd like to have something like this, though I'm not sure how it would work in a modular language like Lua, or a working-image language like Logo.
no subject
Date: 2007-09-30 23:16 (UTC)Perhaps what we're after is a programmable virtual machine which could be hosted/emulated/developed on any machine, and then reunited with some well-designed hardware? Even going as far as it having an explicit assembler, would help, I think (underneath the proper language). I'm thinking of addressing modes, stacks, and so on, again, for advanced children, which no one need deal with per-se any more, but is a brilliant background for when encountering issues like "call by...", virtual addressing, cloning/referencing, etc.
no subject
Date: 2007-09-30 23:18 (UTC)no subject
Date: 2007-09-30 23:22 (UTC)no subject
Date: 2007-09-30 23:26 (UTC)no subject
Date: 2007-10-01 00:11 (UTC)no subject
Date: 2007-10-01 07:58 (UTC)no subject
Date: 2007-10-01 07:59 (UTC)no subject
Date: 2007-10-01 08:00 (UTC)no subject
Date: 2007-10-01 08:10 (UTC)Thanks for the pointers. I explicitly do not want anythinger that runs on a big computer, especially not something webby. It's too unsafe, and more difficult to convince the child that they can make something as good as anything else on the system.
no subject
Date: 2007-10-01 08:19 (UTC)no subject
Date: 2007-10-01 09:12 (UTC)Which aspects of programming are you thinking of teaching ? What age child ?
I would have thought that children would learn from programmable robots earlier than a keyboard/mouse/screen computer.
As well as LEGO mind-storm, I'm thinking of the Logo Turtle and perhaps Big Trak (though it was probably too expensive). Did you know that programmable robots go back at least to the ancients Greeks (see New Scientist, 04 July 2007, issue 2611 "The programmable robot of ancient Greece" - http://technology.newscientist.com/channel/tech/mg19526111.600-the-programmable-robot-of-ancient-greece.html
if you have access) ?
no subject
Date: 2007-10-01 09:12 (UTC)no subject
Date: 2007-10-01 09:36 (UTC)no subject
Date: 2007-10-01 10:16 (UTC)no subject
Date: 2007-10-01 10:59 (UTC)http://web.inter.nl.net/users/J.Kortink/home/hardware/gommc/what.htm (might not count as "sensible" :)
How useful is it to plug old computers into modern storage? So long as it has some suitable convenient stuff of its own...
How about the Amiga 500? Archimedes? Both have graphical WIMP interfaces, are reasonably programmable (albeit in BASIC), have hardware manuals which aren't too heavy, and use floppies for removable storage (although they aren't terribly durable and not easy to write from a regular PC)
If you go for the Linux PC approach maybe run some sort of VM/emulator on it to pretend that the system is simple? Although that will result in a "matrix" moment when the kid realises what's actually going on.
I'll ask Eben about his thing, I don't think it's on the web yet as it's not finished.
no subject
Date: 2007-10-01 11:26 (UTC)no subject
Date: 2007-10-01 11:28 (UTC)no subject
Date: 2007-10-01 11:29 (UTC)Or you build on top of a portable gaming platform that kids are already using or might want to use for gaming, so they wouldn't have to buy extra hardware.
no subject
Date: 2007-10-01 11:30 (UTC)no subject
Date: 2007-10-01 11:39 (UTC)I think this kind of stuff might be good (for someone) to focus on from the start. Also, it might be worth talking to
no subject
Date: 2007-10-01 11:55 (UTC)I don't think virtual simplicity has much of an advantage over a simplified kiosk-style userland. However I'm not sure if gradually revealing more and more layers of Unix complexity will be fun or overwhelming. I wonder if something like Lego Mindstorms can be the small entirely-comprehensible computer, or if that's too much of a cop-out. Dunno.
no subject
Date: 2007-10-01 12:05 (UTC)no subject
Date: 2007-10-01 12:08 (UTC)no subject
Date: 2007-10-01 12:18 (UTC)no subject
Date: 2007-10-01 12:28 (UTC)But object variables are by default *references* which is quite elegant, but possibly confusing when you're first introduced to them...
no subject
Date: 2007-10-01 12:50 (UTC)I know of no good or even passable programming language for teaching the basic principles and best practice of our craft. This may reflect the fact that I have such a poor academic background; I am certainly no teacher and, being largely self-taught, I suspect that I would be terrible at it.
Nevertheless, there have been three attempts at teaching me programming, starting with BBC Basic in an ad-hoc after-school programme: I 'mastered' Basic very quickly, more through my own exploration that a decidedly undemanding and unispiring selection of teaching texts. However, I rapidly tired of the limitations of the language and it seemed that there was very little I could do with my new-found knowledge; worst of all, there seemed to be no obvious progression between Basic and the 'real' world of compiled code for commercial applications.
Nevertheless, this elementary training served me well when, as a student civil engineer, I used Casio Basic in bringing the digital world to the construction site. Note, however, that I effectively started from scratch on VBA in MS-Access: it seemed that nothing I had learnt on earlier forms of Basic was remotely recognisable.
My second introduction was FORTRAN-77; I found it very easy to pick up, as did my classmates. Admittedly, we were all engineering undergraduates, numerate, skilled in algebra, and technically-minded. We did very little text-handling, and I doubt that we could (or should) have explored that, but Fortran proved to be a very effective teaching tool. The question is whether it is still relevant, and whether more modern programming techniques can be implemented in it - or, indeed, whether you could teach a child Fortran, as they would lack an existing background knowledge of algebra and mechanics.
Third time 'round, and DeMontfort University had a two-pronged approach: start with elementary programming in Modula-2 (a derivative of PASCAL, with support for libraries), and progress to an advanced language (C++) while using SmallTalk to teach the principles of Object-Oriented programming. In theory, this is the correct approach: you would no more start someone off on C++ than take a learner driver out of his or her Ford Fiesta and strap them into an F-16. In practice, Modula-2 was too much like driving a milk float or a pedal car, and it rapidly became drudge-work. I truly cannot see how you would engage a child with even the most skilfully-constructed exercises in this family of languages.
But... Learning to program rigorously and carefully in procedural Pascal stood me in good stead when I started writing commercial code in Visual Basic. Many, many mistakes were avoided. And the bane of my life is unpicking bad C++ written by the Quants, who are taught to code in it without being taught how to program.
I still have no idea how to teach anyone O-O programming. I hear good things about SmallTalk from developers I respect but, for us, it was endless handwaving and talking about tasks in abstract terms, which never seemed to get anywhere concrete with recognisable components performing discrete tasks. I'm self-taught, and it says something that I came to understand inheritance through discovering the limitations of VB! Even with the best of tools, it takes a talented teacher to explain the concepts of O-O and I suspect that the majority of taught courses teach nothing more than the useful-in-real-life art of using buzzwords and skilful handwaving to impress an ignorant audience while concealing one's own conceptual confusion.
Which leaves me contributing nothing to your discussion. Functional is the way to go, especially when teaching first-timers, because you can see it working; but I lack a formal training in it and would do well to leave such advice to experts. I'm told that Python is the best contemporary language for encouraging legible code and, having seen some, I believe this to be true. But that is hardly a useful (or even reliable) recommendation, either. Logo is new to me: I haven't seen it in use.
For someone who is arguably among the most commercially-successful coders on your friendslist, I have to admit that the best I can do turns out to be a miserable excuse for a worthwhile answer.
no subject
Date: 2007-10-01 13:53 (UTC)Educational software is almost all entirely crap because it's not written by teachers or parents, and cannot be written safely by teachers in a modern networked environment. By putting machines which children can program, there's a good chance that parents and/or teachers will have sufficient brain and time, between bringing children up, to implement something.
The educational and "play" (rather than game) software available for the Beeb really hasn't been surpassed, unfortunately, :(. I used to say this expecting to be controversial, but the vast majority of people I've met in the field seem to agree, :(.
no subject
Date: 2007-10-01 14:00 (UTC)On the other hand, that's a minor point technically. I wonder if you can have an internal USB port on the Linutop?
I think pen drives are ideal as a modern storage mechanism. Kids often like dinky stuff like that.
no subject
Date: 2007-10-01 15:46 (UTC)I'm not really qualified to hurl rocks in the OO/non-OO debate, but the language I'm most interested in learning for the fun of it, as opposed to work (where Java and JavaScript are top of the list) is Max/MSP or the (closely related) Pd - both of which are pretty extremely graphical. They're as special-purpose as it gets, though.
no subject
Date: 2007-10-01 16:16 (UTC)I'm a big fan, and have made real use, of both.
no subject
Date: 2007-10-01 18:21 (UTC)I'm reminded of the OpenGL function glutSolidTeapot()...
no subject
Date: 2007-10-01 18:28 (UTC)I suspect that OO is one of those things where the real reason for doing it is that it makes it easier to write (some kinds of) large programs. So it's very hard to come up with useful teaching examples because if they're sufficiently large that OO is obviously better then the example is hard for the student to grasp and would take forever for the teacher to explain. On the other hand if the example is small enough to be a sensible example then the student not unreasonably thinks 'what is the point in all this OO complication?', and possibly 'this bizarre contrived example bears no relationship to the Real World'.
The design patterns stuff I think suffers from this to an even greater degree.
Debug.Assert
Date: 2007-10-01 22:56 (UTC)I have to agree with that. Interpreted code is a very effective way to understand a computer program. Note, however, that commercial variants of Basic have both an interpreted and a compiled mode; the majority of VB developers are unaware of this through ignorance, the majority of C++ developers through disdain.
But all of us use 'stepping through the code' debuggers - a feature of modern IDE's which never ceases to astonish me; halting a compiled program, picking up the pieces and running it line-by-line on-screen as if it was an interpreted language.
no subject
Date: 2007-10-01 23:00 (UTC)No, programmes don't have to be large before they benefit from O-O design: think of running next year's income forecast on a mixed portfolio of 20 bonds and shares.
no subject
Date: 2007-10-02 08:20 (UTC)Re: Debug.Assert
Date: 2007-10-02 18:35 (UTC)no subject
Date: 2007-10-04 09:49 (UTC)I also think your worry about Basic is misplaced. Someone who has aptitude for programming will have no trouble moving on to other languages; someone who gets hung up on the very minor differences between one programming language and another is going to have a lot of other difficulties.
By the way, I think Blitz Basic has a lot going for it. It's easy to draw stuff on the screen and it has 3d graphics built in. I would have loved it as a kid.