I've learned a lot of computer languages in my time. And I've learned a lot about learning languages.
Right now, I'm picking up Ruby on Rails for an ultra-top-nonsecret project for work. I'm actually reading a book on learning Rails: a nice book except for a few code typos.
In all honesty, I like the typos. When you compile something and it doesn't work, you're forced to go back through whatever you've typed and try to understand where it is failing. In tutorials like these, it's usually pretty easy. Even if you typed the tutorial carefully considering every line (which you didn't, nobody does), you don't really have a deep, semantic understanding of what's going on since you didn't design the code. You don't understand the architecture of the program.
Learning the architecture of a language is the hardest part, assuming you're learning a language with new architectural features and not just another Java clone. (If you don't know what I'm talking about, you need to learn LISP. Now.)
I admit, some of the languages I have learned, I have learned "badly". That is, I ignore the architecture and simply use "standard" architecture with new syntax. Bad practice, so why did I do it?
Because tutorials are crap.
This doesn't reflect on the makers of the tutorial! The best tutorials in the world... are crap. It's sort of like trying to teach someone how to make a spaceship using only quotes from eighties movies. No matter how clever your references are, it's not gonna fly.
And it's funny. Flawed tutorials actually teach you more, because they make you struggle to get your code to work. In the process, you learn more about the language than the rest of the tutorial combined. The rest of the tutorial is just a reference - it's that moment when you have to fix it that it gels.
It stands to reason that this could be done on purpose.
More specifically, it stands to reason that it could be done in a game.
I've tried creating games of this nature before, but it's very difficult to get the interface to be good enough. My incomplete mini-game Turing's Prison (now mysteriously not available, hm...) was a mediocre first stab.
Using a game, you could teach any number of programming concepts in any sequence. In my mind, it teaches you a concept, then pushes that concept to its complexity limit. Then it teaches you a new concept that simplifies all that complexity. It does all of this in the framework of a game: programming robot(s) seems most likely, although in Turing's Prison I used the code to control the rooms instead.
For example, you learn about basic single-tape, single-head Turing machines. You program your robot to do simple tasks using them. Then you slowly add more complexity: multiple tapes, multiple heads, registers, IO pipes...
Eventually the player has built a "Turing program" of very high complexity. Building a more complex Turing program would take more than one programmer and a lot of hours.
So you introduce something like assembly with jumps and hardware interrupts. That gets more complex, so you introduce something that wraps functions, like Basic. From there you can keep adding functionality in any way you please: object-oriented code, lambda functions, generative code, unit tests, databases, networks, distributed processing, alternate IO...
I can easily see it being fun. But... programming it is very hard!
What do you think?