Powered by Sorcery

Federico and I had one of our long, meandering discussions today, touching on a range of topics. One of the things we’ve been talking about recently is how to get beginners interested in the fundamentals of computing, including how said fundamentals should be taught, and how to enable exploration. We agreed that since the 80s, computers have become easier to use (for mundane tasks), but in many instances also harder to program.

For instance, one of the exciting things we could do when we were kids was make the computer draw pixels on the screen. When you learn how to do this, the possibilities for further exploration are endless (no I’m not coming out to play, I’m pushing pixels!). Maybe you’d show off your first wicked graphics hack (random pixel spray #5) to your dad, and he’d go “oooh,” and reward you with a floppy disk on which to save it. After a while, and with some help, you’d be exploring curves, fractals, automata or perhaps a Snake clone of some sort. Eventually you’d grow up and be excited about serious shit.

So how would you go about doing that today, on a PC running GNU/Linux? The answer is, you need to learn an API. If you’re lucky, someone will set you up with a sandbox, or you’ll run into SVGALib and get it to work on your graphics adapter. If you’re unlucky, you’ll try to do it with a GUI toolkit - and fail. Case in point, GtkDrawingArea takes some figuring out. You must be a very motivated beginner if you’re ever going to see your pixel using that.

Now, for fun-loving hackers who somehow do manage to produce pixels and such, I have a book recommendation; it’s called The Magic Machine, and is a gold mine of fun hacks, based on a column in Scientific American from back when it didn’t suck quite as much. Ignore the title and cheesy cover - the book introduces topics like fractals, artificial life and text processing (including markov chaining) in a way that makes for easy implementation, but without being tied to any specific architecture, technology or knowledge base. I lost my copy somewhere between Fredrikstad, Norway and Xalapa, Mexico, but I remember it as one of the books that got me excited about programming. Technology books like XML in a Nutshell don’t do that.

One Comment

  1. someone Says:

    Have a look at starlogo or netlogo. Those are attempts at dealing with this problem. I agree, though. There should be something like a python library where you can say something like:

    import draw
    w=draw.getWindow(100, 100)
    w.plot(50, 50, draw.RED)
    w.plot(25, 25, draw.BLUE)
    w.draw(22, 22, 44, 44)

Leave a Reply

Please copy the string E8l1qB to the field below: