25 years

February 25, 2008 at 12:23 AM | categories: python, oldblog | View Comments

Well, this year will mark the 25th year that I've been writing code, so at some point later in the year I'll probably have some sort of party/drinks relating to that, since it means something (not sure what :-) ) to me. I have to decide a date where that makes sense, maybe some of the following will make sense. This post is a bit self indulgent as a result.

I can't give a particular date, but I suspect the date is probably sometime around easter 1983 - based on some very vague memories. I'd been interested by computers and programming for a couple of years at that point, mainly due to seeing some schematics in Doctor Who weekly saying how to build your own K9. I've found the cover of that magazine here for those who wonder what got me interested.

Anyway, the idea of making a robot dog - especially when you're given schematics, is like a red rag to a 7 year old. Have cardboard boxes, will get started. Anyway over the next couple of years, amongst all the other things little boys do, I read more about robots and so on in kids books and it became more clear that in order to build a robot, you needed to know about computers. As a result the "maker" culture that's sprung up in California amuses me - in a good way (it's a good thing after all) - it was this desire to "make" something that drew me into software in the first place.

It's worth stopping here and considering this: the schematics for K9 looked like something a child could, with effort, actually make. That moved it from the realms of complete fantasy and unreachable into the realms of the possible (which is of course what good science fiction really is). Not only that, it made robots and computers seem like something a child could do, rather than "just" something to be watched. Having seen the schematics again some years later, it is rather beyond the scope of a 7 year old, but that wasn't really the point.

Fast forward a couple of years, and my brother (David) had been interested in programming since they'd done something to the Commodore PET at school which meant they'd been encouraged to fix it. The side effect is that eventually David (then aged 12 I think) promised to explain the BASICs to me.

I still remember the first program I tried to write. I'd been told at that point that "computers have to be told everything, and require very precise instructions and can tell you things". So I wrote down my first program, and the next time we were near Dixons in Lion Yard in Cambridge, (then next to the library) I typed it into one of them (I think a Vic 20).

Unsurprisingly, it didn't actually work because of a rather major missing detail in the above - the fact that computers use special languages for their instructions.

For your amusement, here's that first program (more or less):
"You are a computer
 I am a human
 What are you?"

Since I was 9 at the time at the absolute oldest, I'm going to give myself some credit here - it was a good try, and but with more experience I can see just how demanding a set of conversations that is to a machine with less than 16K of RAM. (I was more or less expecting the machine to pass a subset of the Turing test I now realise, which is an entertaining assumption!)

Fast forward a little while (autumn '83) and my brother had by then taught me the basics of BASIC, what a string was, etc and I was good to do, sans the detail of not actually owning a computer. At that point in time (1983), my Dad got hold of a ZX81 - hardly cutting edge then (the ZX Spectrum existed, in not only 16K but also whizzy 48K version - the ZX81 had a whopping 1K of memory - 0.4K actually usable, and a 16K RAM pack), but it was the first micro I had any access to, beyond playing with the microcomputers in Dixons and Boots. (Looking back, I think those shops were remarkably tolerant in comparison to today!) Heck, they were being almost given away as prizes at the fairground. However, it was a real computer, and it did work.

Co-incidentally, we also moved back to Cambridge - near Waterbeach, and the primary school I was going to had a book club. So I saved up all my pocket money and at that book club bought my first ever book on computer programming, and to this day I still rate it as the single best book ever that introduced programming. It could be updated I think, but would be difficult to improve.

It was targetted at children, and as a result had fun pictures and diagrams - which were all hand drawn & illustrated - but were largely of little robots running around inside a computer. (See, things go full circle sometimes :-). The robots were tasked (literally) with running around moving bits of data from here to there. To sending stuff to the display, putting dots into a big grid to draw pictures. They stood in front of racks of boxes (much like an old fashioned hotel lobby with pigeon holes for keys/messages) where data was put & labelled and so on.

Quite simply it was fantastic :) Not only that, but it was only 48 pages long. Yes. 48 pages.

For those that remember, yes, this was one of the Usborne computer books, and I'm amazed at how dumbed down they've become over the years. (I picked up their "Starting Computers" a few years back to see how it'd "improved"... :-/ ) They were perfectly targetted - they were marketed as part of their "scholastic" series in schools as suitable for 9-12 year olds, and they were perfect. They showed you how to make games. Some how to do graphics. Another taught you electronics projects, and yet another even showed you how to make a robot.

Whilst I still have my book on Computer Graphics and on "how to build your own robot" from those days, I'd mislaid that book: Introduction to Computer Programming - by Brian Smith. However, many years later I'd borrowed from the library an omnibus book "The Beginner's Computer Handbook" - which featured 3 Usborne books in one: "Understanding the Micro", "Introduction to Computer Programming" & "Computer Space Games". That, along with other usborne books of the time were highly responsible for boot strapping my early interest.

By 1984 I'd written a simple "Logo" interpreter. Come 1985 or so, my parents splashed out on a Commodore Plus/4 and for various reasons (mainly fun), I ended up writing a pre-emptive task switching monitor in 6502 assembler for it. (Yep, aged 12 or 13 I wrote an incredibly basic pre-emptive multitasking operating system for an 8 bit micro those who understand what all those words mean.)

Then along came the Amiga, and I kept on building, eventually leading to writing a paint program for my GCSEs - but this was different - you painted notes on a scale - so you literally painted music. That was probably, ironically, one of the few times I've been forced to struggle with a microsoft product - since that was writting in Amiga Basic - which was written by Microsoft. It was also probably one of the last large programs I ever wrote in basic. I've completely forgotten what I did for my 2nd year a level computer science course now. It was some sort of database system.

Part of the reason for that being my last BASIC program is probably due to finding the astounding book "The Cartoon Guide to Computers" by Larry Gonick. Aside from anything else what's perhaps most astounding about it is that it teaches you enough electronics, enough boolean logic, enough about how logic gates work, how a computer is subdivided into its constituent elements, not just in a high level way, but all the way down to how microcode inside a CPU works to implement CPU opcodes that you write for assembler. Stunning book. It was the logical next step after the Usborne books. From then on it was Pascal & C which lead to Amiga E & Standard ML - which taught me object oriented programming and functional programming respectively.

Given my experience of using a pre-emptive multitasking OS, and having written the basics behind it myself before the age of 16, it should come as little surprise that I wasn't particularly impressed with Windows 3.0 when it came out some years later, and the fact it locked up when it shouldn't. Moving from the Amiga to Unix however was pretty natural.

Anyhow, enough digression, I continued to progress, with formal education, but always with a fair amount of play with new ideas. It's easy to think that because I work with computers that somehow I went through the route that some people have of cross training after an unrelated degree, or that I simply did a computer science degree because I couldn't think of anything better to do. However, the reality is, whenever I start something new, learn something new to do with a computer, I'm still learning with that same enthusiasm I had as a 9 year old.

Show me the results of applying text mining to the output of the BBC website, and I jump with glee, not  just wanting it, but knowing how realistic it is to want. Show me multi-touch, and I instantly see that all I'm waiting for is a display that I can actually work with to do something fun with it. Tell me that there's a new speech synthesiser package for Linux that actually works and I integrate it with Kamaelia:
Pipeline(
    Textbox(position=(20, 340),
                     text_height=36,
                     screen_width=900,
                     screen_height=400,
                     background_color=(130,0,70),
                     text_color=(255,255,255)),
    PureTransformer(lambda x: str(x)+"\n" ),
    UnixProcess("while read word; do echo $word | ./espeak -w foo.wav --stdin ; aplay foo.wav ; done")
).run()
Yes, that's a toy. But it's fun. Partly for me, partly for others. But I now wonder why my system doesn't talk as much as it could. After all the above can be integrated with anything, so sooner or later my computer will be talking more. Or it'll find its way into a system that needs to talk.

However, we come back now to full circle. The extremely observant among you will have noticed this above:
"The robots were tasked (literally) with running around moving bits of data from here to there. To sending stuff to the display, putting dots into a big grid to draw pictures. They stood in front of racks of boxes (much like an old fashioned hotel lobby with pigeon holes for keys/messages) where data was put & labelled and so on."
In Kamaelia, my primary metaphor has always been "imagine someone sitting at a desk, with a bunch of intrays(inboxes) and out-trays. They do work based on the data they recieve and send it out the out-trays. Then another person - a postman - comes along and moves the data from the out-trays to the in-trays.". Now clearly this is a metaphor - but there's a few things I've learnt about computers over the years:
  • Metaphors matter.
  • Good metaphors are hard to come up with, perhaps the hardest thing in computer science.
  • That if you can think of a metaphor, you can use it to write code.Therefore, why not pick one that you enjoy?
  • Any good metaphor can be represented by using pictures of humanoid robots.
And that last point brings us to the silly little secret in Kamaelia. When I'm thinking "someone sitting at a desk", I'm picturing a Kids book on Kamaelia with little robots sitting at a desk. When I'm saying "someone comes along to do deliveries", I'm thinking more little robots with roller skates on doing the deliveries between components. When I added in the Co-ordinating Assistant Tracker - the assistant - it was very much added in because there's a very practical metaphor there - that of a team assistant. (You have a team of little robots all working together, and they tell the assistant what they're doing if they're willing to get requests from other robots)

So there you have it, not only am I really wanting to make Kamaelia accessible to the average developer, I'm actually thinking of the average 9-10 year old who wants to be a developer - or perhaps even the 6 1/2 -7 year old who decides "I want to build K9", and at the end it's really due to me remembering how I got here - an interest in building K9, books explaining to kids how robots work, books explaining to kids how to program, the cartoon guide to computing (and underlying electronics, physics and signal theory...), Simula BEGIN, and many more similar books, and hardware/software systems that made these things doable, all in short friendly descriptions, but ones which weren't skin deep.

The books you get today are just awful. 100s (or 1000s) of page tomes on introducing a concept that used to be possible to explain to a 9 year old in a 48 page book with pictures of robots. It must be possible to get back to that stage. Even the "head first" books are awful - they're a nice idea, but just too large to be actually any use IMO. Anyhow, if no-one writes that book, I guess I'll just have to update the usborne books of years ago with something new. (Which, I do actually plan to do - I've scoured amazon and similar for places selling the originals, and getting somewhere there)

The new book will have to deal with video, multimedia, TV, games, 3D, as well as things like web, and all that whizzy stuff, with a nice and easy way of bolting these things together, but in a way that prepares anyone reading it for a world of writing concurrent software. It's always been an underlying agenda in Kamaelia, but this year I think that'll have to happen.

Along with finally making a real K9 :-) (more on that anon)

blog comments powered by Disqus