I've been writing a program for teaching people how to program:

And I've blogged about it on the work blog. I start by quoting Cory Doctorow's Little Brother:

And I've blogged about it on the work blog. I start by quoting Cory Doctorow's Little Brother:
If you’ve never programmed a computer, you should. There’s nothing like it in the whole world. When you program a computer, it does exactly what you tell it to do. It’s like designing a machine — any machine, like a car, like a faucet, like a gas-hinge for a door — using math and instructions. It’s awesome in the truest sense: it can fill you with awe.
A computer is the most complicated machine you’ll ever use. It’s made of billions of micro-miniaturized transistors that can be configured to run any program you can imagine. But when you sit down at the keyboard and write a line of code, those transistors do what you tell them to.
Most of us will never build a car. Pretty much none of us will ever create an aviation system. Design a building. Lay out a city.
Those are complicated machines, those things, and they’re off-limits to the likes of you and me. But a computer is like, ten times more complicated, and it will dance to any tune you play. You can learn to write simple code in an afternoon. Start with a language like Python, which was written to give non-programmers an easier way to make the machine dance to their tune. Even if you only write code for one day, one afternoon, you have to do it. Computers can control you or they can lighten your work — if you want to be in charge of your machines, you have to learn to write code.
no subject
Date: 2009-08-13 01:37 pm (UTC)I remember using that in highschool *mumble* years ago! Most interesting thing I did in that class - the rest of it was typing and proofreading for some inexplicable reason...
no subject
Date: 2009-08-13 01:38 pm (UTC)no subject
Date: 2009-08-13 01:39 pm (UTC)no subject
Date: 2009-08-13 01:45 pm (UTC)[Feeling quite bad for not managing to do much more programming since you taught me stuff. It's not due to lack of interest, just everything being very hectic].
no subject
Date: 2009-08-13 01:53 pm (UTC)no subject
Date: 2009-08-13 06:46 pm (UTC)no subject
Date: 2009-08-13 01:53 pm (UTC)no subject
Date: 2009-08-13 01:55 pm (UTC)no subject
Date: 2009-08-13 02:02 pm (UTC)I never built a car, but I did rebuilt the engine on my VW Beetle - twice...
no subject
Date: 2009-08-13 08:16 pm (UTC)For me it was the fact that the family computer came with a manual which introduced BASIC and we had very small budget for buying games .. so I'd experiment with programming.
In many ways computers were simpler then. (Not necessarily easier due to RAM/feature constraints, but definitely simpler.)
no subject
Date: 2009-08-14 09:34 am (UTC)no subject
Date: 2009-08-14 09:36 am (UTC)no subject
Date: 2009-08-14 11:18 pm (UTC)The one slightly critical comment I'd make on this is that the first line should say '.. how to program in Python', but I haven't played with it properly yet.
no subject
Date: 2009-08-14 11:19 pm (UTC)no subject
Date: 2009-08-14 11:45 pm (UTC)The former means not having to answer 'Why do some words have to have (parentheses) at the end?' with 'Because that's what Python insists on', just a very intuitive (YMMV) graphical IDE where you put building blocks in the place you want and get very graphical results. Does it do the indenting of source for you? If not, that's another thing I'd need to explain, etc.
The latter means a very interactive environment where you're encouraged to factorise and reuse short definitions.
This doesn't stop me being very impressed with it and I accept seven year olds may well not be your target audience :)
no subject
Date: 2009-08-15 07:56 am (UTC)no subject
Date: 2009-08-13 02:12 pm (UTC)I agree that things are more fun when you know how they work.
no subject
Date: 2009-08-13 02:19 pm (UTC)no subject
Date: 2009-08-13 03:38 pm (UTC)no subject
Date: 2009-08-13 02:38 pm (UTC)no subject
Date: 2009-08-14 11:06 pm (UTC)no subject
Date: 2009-08-13 03:12 pm (UTC)There's still a fair few people seem to learn some kind of programming from the desire to write a roguelike game - a roguelike remaining a practical single-person hobbyist project.
I think the other approach is what you're doing - a game with a programming environment inside it which is secretly a real programming language. Zach's Manufactoid ( http://www.zachtronicsindustries.com/pivot/entry.php?id=18 ) is a similar idea with Lua which might be interesting (Windows-specific, alas). There's a bunch of robot-arena Flash games with languages specific to the game, too, but some of them have proper flow control and whatnot.
no subject
Date: 2009-08-13 03:16 pm (UTC)no subject
Date: 2009-08-14 09:43 pm (UTC)I think a nice thing about game programming in general is that even if you're just doing something that isn't particularly original, it's still easy to add your own original creativity (levels, rules, characters etc).
no subject
Date: 2009-08-13 05:07 pm (UTC)Can you advise what languages would be worth looking into?
no subject
Date: 2009-08-13 06:46 pm (UTC)Graphical stuff sadly is hard in any modern environment, but you can get very nice results out of Cairo, which is what I use for my electoral charts - in Python, naturally :-)
no subject
Date: 2009-08-13 06:50 pm (UTC)One of the things I wanted to make was one of those simple ecological models (sharks eat the fish so the fish population drops so the sharks die out a bit so the fish population booms) that I could make much more customisable. The logic is easy, trying to write a program to display it was such a nightmare I gave up.
no subject
Date: 2009-08-13 06:55 pm (UTC)no subject
Date: 2009-08-13 08:10 pm (UTC)I think Processing make grapical stuff very very easy. Simple to invoke, deploy, and with tons of great examples online. :)
no subject
Date: 2009-08-13 08:17 pm (UTC)You can write fairly complex things that run inside a browser these days...
no subject
Date: 2009-08-14 05:06 pm (UTC)no subject
Date: 2009-08-15 02:03 am (UTC)I thought that Java was nice in that it includes a graphics library as standard, and it's easy just to write an Applet that you can immediately view in a browser.
In a lot of cases though, you can use many graphics libraries with many programming languages. What have you been trying so far to do graphics? I've found SDL is fairly easy to use for doing 2D game-style graphics.
no subject
Date: 2009-08-13 06:04 pm (UTC)A good friend of mine works a Microsoft and has spent the last few years trying to achieve the same thing... The project is called Kodu and is available right now on XBox Live...
I also started to do a similar thing inside of a web browser myself, it works quite well but has at lest one annoying bug (entering in new code after hitting the run button then hitting run again doesn't stop the first version of the program- so you end up with two versions of the program running concurrently). That said, I think it's pretty dang cool:
http://www.tinyurl.com/processingnow
and the javascript only version:
http://www.tinyurl.com/javascriptnow
Go to either of them and hit the "run" button. Certainly a robot/ turtle environment is easier and more illustrative though. :)
no subject
Date: 2009-08-14 11:35 am (UTC)no subject
Date: 2009-08-14 04:29 pm (UTC)Javascript + canvas is teh Roxor! (the fact that you type in Processing and not javascript is really just a nicety, you could make it parse any input language- including python)
Gotta get a fix for that bug though. If I fix that bug then people can have nearly instant iteration times: try some code, hit run, change a var, hit run, add a function, hit run, etc. It's not nice to force people to refresh the window each time. Fixing it will mean digging into the processing.js file to see what it is really doing to set up the loop though.
That said, the bug can be kinda fun if you write code for a random bouncing ball... every time you hit run (after the first time) it adds another one (which can sometimes be seen in the flickering). :)
You might have noticed the page doesn't make use of any server side features so you can just save the files to your desktop and run all this in a browser even when away from any network...
I'm sure you could add a robot/maze version and I wonder if there is a python.js laying around somewhere...
code for a random bouncing ball:
float radius, xPos, yPos, xVel, yVel;
void setup() {
size(200, 200);
smooth();
radius = 16 + random(16);
xPos = radius + random(width - radius*2);
yPos = radius + random(height - radius*2);
xVel = random(-5, 5);
yVel = random(-5, 5);
}
void draw() {
background(255);
xPos += xVel;
yPos += yVel;
if(xPos + radius > width || xPos - radius < 0){xVel *= - 1;}
if(yPos + radius > height || yPos - radius < 0){yVel *= - 1;}
stroke(0);
fill(0, 50);
ellipse(xPos, yPos ,radius*2, radius*2);
}
no subject
Date: 2009-08-13 06:20 pm (UTC)(am someone who a)made little things in BASIC and machine code on a ZXSpectrum as a tiny thing and somehow then forgot all about it b)when riding bikes, did a mechanics courses coz I wanted to know how my machine was doing what it does, and have recently begun to get frustated with how little I understand about a machine with which I spend so much time interacting.)
no subject
Date: 2009-08-14 10:18 am (UTC)