What do I teach my kids instead of line number BASIC?
February 21, 2009 11:32 AM   Subscribe

What's the modern day equivalent of old school "line number" BASIC as a tool for young children to play and learn with?

As with many of us of a certain age, I spent a lot of time writing software in line number BASIC learning how to break problems down into component algorithms and generally getting a sense of how electronic computing works. The advantages of such a language as a learning tool are pretty well known: the constrained vocabulary and relatively powerful primitives make it fairly easy to learn, although obviously not the kind of thing you'd want to write production software with. I'd like to share at least a sliver of this experience with my own children, but the chances of getting them to sit down in front of a crumbling TRS-80 or Apple II in order to learn are slim.

So instead I'm looking at other options. Ideally I'd like a language and execution environment that is somewhat multiplatform, has graphics and sound support, uses a language I know or can learn relatively easily in order to teach, and most ideally is procedural rather than OO. A few I am considering are:

LÖVE - a Lua system for creating games. Lua looks fairly approachable although I don't know enough of it to teach, and I'm not entirely sure about making young children wrap their brains around the idea of callbacks in order to get anything done.

Pygame - a framework for Python game creation. I only speak a little Python but it's learnable, I suppose, and the presence of an "immediate mode" interpreter is compelling in terms of being able to learn the basics interactively. However, I'm not at all convinced I want my kids using an OO language before they understand procedural programming. That seems like putting the cart way out in front of the horse in terms of depth of learning.

Squeak - a Smalltalk implementation. Yet another OO language, although at least a fairly pure one, and I can probably dust off my long-rusted Smalltalk skills to teach it. But honestly, who even knows or cares about Smalltalk any more?

Scratch seems like a Squeak-derived project of some kind, and the visual programming approach seems aimed at very young or only partially-literate learners. I'm not sure this is the kind of thing I'm interested in at all.

Processing has some of the attributes I'm looking for, but may not be an ideal learning language due to being extremely visual in emphasis, the OO, and the Java syntax.

Visual Basic is really BASIC in name only; it's not a language I want to teach, nor one I'd want my children to bother with, and it's tied utterly to a platform I don't particularly care about.

So, folks, I'm not seeing a very attractive range of tools. What am I missing? Aren't there tools for kids to just sit down, play with, and make things? Or is the entire concept of teaching fundamental computer literacy an obsolete one in the modern age of children surrounded by closed, sealed, consumer-oriented devices that are made by distant wizards?
posted by majick to Computers & Internet (42 answers total) 34 users marked this as a favorite
I've only got other ancient languages to offer.
There's Logo, which sort of in-between Scratch and Pascal. Also, I believe you can still get older versions of turbo pascal for free.

I used to run a computer lab at an elementary school, and I found that kids didn't have any trouble with the idea of calls and subroutines, as long as the syntax was pretty simple.
posted by dogwelder at 11:41 AM on February 21, 2009 [2 favorites]

You missed out the best choice : Javascript.
It's a very full featured language, and all you need to get started is a text editor and the web browser you were already using.
Plus it's actually useful - it's a core technology of the web and not going away, and I have met highly paid Javascript programmers. Once you've written something cool you can put it on the web and share it with your friends. You can make your mySpace page do cool things. You can easily pull in information from the web in your programs and do cool things with it.
It's also a great foundation for other languages as the syntax is so similar to C and Java.
posted by w0mbat at 11:47 AM on February 21, 2009

Hackety Hack. It's in the middle of some revamping (here's the "old" version), but it's a very easy-to-follow intro to Ruby.
posted by niles at 11:48 AM on February 21, 2009 [2 favorites]

The object-oriented features of Python are optional. You can stick to procedural programming if you think that is easier.
posted by grouse at 11:49 AM on February 21, 2009

There's a great book, Snake Wrangling for Kids, intended for introducing programming to kids using Python.
posted by PueExMachina at 11:53 AM on February 21, 2009 [1 favorite]

You might look at Alice. It is OO, but it is fund for kids to play with, and they get to do fun graphics with it.
posted by procrastination at 11:54 AM on February 21, 2009 [1 favorite]

Javascript has some good attributes. It makes stuff that can be seen by any web browser, and it doesn't use strict typing, so you don't have to worry about improperly declared variables. But it also can have weird looking variable names.
posted by dogwelder at 12:01 PM on February 21, 2009

Wow, I'd never heard of Alice or Storytelling Alice and while the idea of visual programming really does put me off at a visceral level -- I strongly dislike the idea of starting with abstractions before understanding the fundamentals being abstracted -- it's hard to argue with things like:
"Users of Storytelling Alice were more than three times as likely to sneak extra time to work on their programs as users of Generic Alice (51% of Storytelling Alice users vs. 16% of Generic Alice users snuck extra time to program)."
One of the children in question is in fact a middle-school age girl, the specific intended audience of Storytelling Alice. I'm going to look into this much more closely. Thanks, procrastination.

"Hackety Hack...a very easy-to-follow intro to Ruby."

It's not at all clear what those people are selling -- it seems to be some kind of class in Pittsburgh, PA; or perhaps it's an art show, I can't tell. But a resource that is an "intro to a language" is almost the exact opposite of what I'm looking for. I'm looking for a toolchain that can be used to support my own teaching of my own kids fundamental computer literacy. I did this kind of teaching in the ROM BASIC era, and am looking for a more modern and appealing tool to teach the subject again.
posted by majick at 12:21 PM on February 21, 2009

Oh. I spoke too soon:

"Storytelling Alice is only available for windows-based machines. I do not plan to create versions for Mac or Linux."

And there doesn't seem to be any source available from which to port it myself. What a shame.
posted by majick at 12:24 PM on February 21, 2009

JavaScript sounds like the way to go.
posted by RussHy at 12:26 PM on February 21, 2009

When I was learning BASIC, it was absolutely mainstream, and the same language that grown-up hobbyists would use, which I think was an important part of the attraction. I also thought of suggesting JavaScript but an alternative would be C#. Check out Microsoft Kid's Corner and the free e-book C# for Sharp Kids.
posted by tomcooke at 12:26 PM on February 21, 2009

I started with Javascript around age 11. At the time it seemed silly, but damn, look how important JS is now.
posted by phrontist at 12:28 PM on February 21, 2009

Rereading I noticed the "tied utterly to a platform I don't particularly care about" which I guess would apply to C# as well (more or less, obviously it does exist outside of the Windows environment). In that case I would vote for Java for the same reasons, it's a grown-up, commercially valuable language with as much room to grow as you could ask for. I think the extra interest you'll get from them for the fact that they get to be part of the mainstream adult computing world would more than compensate for the fact that they will be exposed to OO a bit earlier than they might be with some alternatives.
posted by tomcooke at 12:39 PM on February 21, 2009

BASIC is still available. By far the most powerful and easy to use is BBC BASIC for Windows.
posted by Mwongozi at 12:58 PM on February 21, 2009

Just wanted to point out that you can write Python in a procedural style if you want, just as you can write C style code in C++ .
posted by i_am_joe's_spleen at 1:01 PM on February 21, 2009

Also, I have come to appreciate that Javascript is actually a really funky language with functions as first class citizens, closures, and all kinds of neat FP features. In the old days Logo was a sort of Lisp in drag; nowadays maybe Javascript can fill that role nicely.

And how about Ruby? Why's Poignant Guide to Ruby is very accessible for kids - my daughter loved it.
posted by i_am_joe's_spleen at 1:04 PM on February 21, 2009 [1 favorite]

I can't say I've actually used it in a pedagogical setting, but Scratch was entertaining and powerful when I looked at it. It uses the visual layout to build algorithms while reducing the amount of crap to explain like braces or tabs. It's obvious what goes in the loop and what isn't just by the shape.

It also makes typing explicit through shape and color. Normal introductory programming languages do their hardest to avoid typing at all, even though it's necessary; if ("hello world") straight up doesn't make sense.

In short, Scratch makes it very clear that algorithms have structure.
posted by pwnguin at 1:55 PM on February 21, 2009 [1 favorite]

I really like Ruby. A lot of people plug/hype/whatever Python, but it never really clicked for me like Ruby did. I guess it's just my style of thinking. This is the link that niles should have given you WRT hacketyhack. The stuff _why_the_lucky_stiff_ (author of HacketyHack and the aforementioned "Why's Poignant Guide to Ruby") is actually pretty good (if a little art-y), especially in light of Aren't there tools for kids to just sit down, play with, and make things?.

I'm kind of confused by I'm looking for a toolchain that can be used to support my own teaching of my own kids fundamental computer literacy though. Are you talking about teaching C/assembler-style low-level concepts? Languages like Ruby, Python, Lua, and Processing really aren't what you want if that's what you are looking for because they are designed to insulate the programmer from the hardware.
posted by ArgentCorvid at 2:07 PM on February 21, 2009

Kids are very adaptable and will probably take pretty quickly to any of these platforms, as long as they can get quick results of some kind. I think your fear of OOP in this case is a bit misguided as you can cover the basics (an object has methods & data) without going into inheritance & polymorphism & other beasties.

While I like Python and like that it teaches good style right out of the bat, Processing might be better as it's only one click to run whatever you've got in the built in editor. The feedback loop is very tight.
posted by chairface at 3:28 PM on February 21, 2009

I'm not sure why you can't still use BASIC.

I also loved LOGO when I was a kid.
posted by robcorr at 3:49 PM on February 21, 2009

My middle school class was the last to learn BASIC (replaced part-way through the year by a curriculum focused on html and web use). This was in the late 90s, and even with a ton of more modern programming languages around and no real use for it, BASIC was a great way to learn what a programming language is on a basic level and gives you a slice of the history of computing (especially when taught on an AppleII).
posted by Vectorcon Systems at 5:21 PM on February 21, 2009

NodeBox is a good, simpler, alternative to PyGame for learners.
posted by doteatop at 5:36 PM on February 21, 2009

One of the things about BASIC for me was the immediacy: typing in an expression and having it evaluated, or typing in something simple, saying "RUN" and having it go. No editor, no loading, none of that stuff, to start with.

Python has that, as does lisp and a few other languages. Python also has the advantage that for the simple stuff, there isn't really any syntax to worry about (just like old-school BASIC). However much I love lisp, there's no way I'd inflict it on somebody who wants the computer to say "Hi Mikey!"
posted by djfiander at 6:11 PM on February 21, 2009

Not sure if this is too far off what you're thinking of, but Lego Mindstorms might be an interesting way to get into procedural programming. It's a similar concept to LOGO except you're programming the Lego model that you built. The upfront costs are a bit of an issue though - the sets aren't cheap. On the other hand it does let you do interesting gee-whiz kind of stuff, beyond the usual "Hello World" thing.
posted by drmarcj at 6:43 PM on February 21, 2009 [1 favorite]

I tracked down what very simple sample programs (just move an image according to keyboard or mouse commands) look like in Love / PyGame / Processing, which might be informative (I have preemptively disregarded Squeek and Scratch because honestly, Smalltalk?):

Love example
PyGame example (only draws an image, does not move it according to input)
Processing example

Love seem quite simple to teach. The most complicated thing you have to understand in the example is the timestep 'dt', which might be hard to explain unless the children have the math background to understand the relationship between position, velocity, and time (algebra level math).

PyGame seems needlessly complicated, especially considering the example doesn't even deal with input of any sort. To understand the example, you need to know about drawing surfaces, double buffering, that 'blit'='draw', and event queues. I wouldn't recommend it to a completely new programmer.

Processing is about as simple as Love, but the Java syntax makes it look more complicated. Again, to understand the example you have to at least know algebra.

Among these options, I would go for Love.
posted by Pyry at 7:21 PM on February 21, 2009

Definitely go Python. It's not hard, and if they end up in computer science, they won't be sorry they ever picked it up.
posted by Precision at 8:13 PM on February 21, 2009

For comparison with Pyry's examples: 18 lines of code from page 102 of Snake Wrangling for Kids that use the Tk module for Python to create a polygon and moves it in response to the arrow keys.
posted by PueExMachina at 9:13 PM on February 21, 2009

I agree with all the Python lovers here. I can't tell if you're asking for a language with line numbers, but all the line numbers ever did for me was to instill bad habits. If you take those out (plus the GOTO statement), it seems to me that Python is pretty close to BASIC.
posted by A dead Quaker at 9:57 PM on February 21, 2009

It uses the visual layout to build algorithms while reducing the amount of crap to explain like braces or tabs. It's obvious what goes in the loop and what isn't just by the shape.

I'd posit that one of the goals of beginner computer languages is the lesson that precision and accuracy count. Kind of like how you have to know how to do arithmetic in order to use a calculator.
posted by gjc at 10:32 PM on February 21, 2009


I would stay away from Javascript. The fact that it's not compiled and runs differently in every browser is a source of intense frustration to me as a grown-up- making kids test in ie6, 7 and 8 borders on child abuse.

I would say aim high! I think it's much like spoken languages- young kids don't have the inhibitions or set-in-their-ways-ness of grown-ups, so learning OO stuff may come surprisingly easy to them.
posted by drjimmy11 at 11:20 PM on February 21, 2009

Also, since no one has mentioned it yet, I'll put in a plug for the language I use every day- Actionscript 3. it's very object-oriented (although typing variables is not mandatory), and since it compiles in a swf, you can do all the cool animations and effects associated with Flash really easily (especially compared to the nightmare of doing UI stuff in java).

So it might be the best of all worlds: "real" programming that results in cool, fun stuff you can see on the screen.
posted by drjimmy11 at 11:23 PM on February 21, 2009

I haven't used it, but I did read this article about Microsoft Small Basic, which they apparently released late last year: link.

I'm surprised I haven't seen it recommended already. Kind of makes me wish I had a kid to teach. :)
posted by phoeniciansailor at 7:31 AM on February 22, 2009

I learned to program in Hypercard and BASIC, but the only language that really delivered satisfaction for me (nerdy elementary-school boy) was the strange RPN logic of RoboWar. I can tell that many CS grad students procrastinated with that one over the years.
posted by anthill at 12:00 PM on February 22, 2009

Thank you, everyone, particularly Pyry for scraping up some comparative hello world snippets, but everyone else as well. At this point it looks like the best modern tool for immediate-gratification procedural coding is going to be Python's interactive mode, but once everyone's got the basic concepts down we may well weather a change of syntax and jump into Lua and LÖVE in order to make stuff that does stuff.

Alternately, as much as I'm not a huge fan of the language, Java may wind up being it. At least the JVM is conceptually easy to teach, has a pretty clear memory model and stack/heap behavior. The laborious syntax, OO, and edit/compile/run cycle are obstacles but we might be able to overcome them.

Tell you the truth, I'm about this far from teaching them with awk and calling it a day.

Let me just throw a few responses out there so folks don't think I'm not paying attention.

"I think your fear of OOP in this case is a bit misguided as you can cover the basics (an object has methods & data)"

Methods are procedures. You can't explain methods without an understanding of procedures, and -- perhaps because of my own personal teaching style, or merely that my goals very much are not about "teaching the kids to code" -- I'd strongly prefer the kids get some depth with that before dealing with hiding procedures behind object structures.

"Why's Poignant Guide to Ruby is very accessible for kids..."

Maybe the part where I said I didn't want a tutorial wasn't clear, but I don't want a tutorial. I'm perfectly happy to do the teaching. What I want is a language and runtime that supports learning with the same ease that interpreted line number BASIC did.

"I'm not sure why you can't still use BASIC."

The only BASIC interpreters anyone turned up in this thread were a couple of Windows programs and Windows-only software is pretty much out of the running. Or are you suggesting I just fire up a Commodore 64 emulator and try to teach them to make it do something? I thought about it, but I don't want the sheer ancientness of the platform and the obsolete quirks to get in the way of the process.


Honestly, the only major Javascript runtime out there is the browser, which implies dealing with the DOM, which starts running us way off in another direction from what I intend the experience to be. Language-wise I like the cut of its jib, but the browser is just a horrible, learning-hostile place to live unless you already understand the DOM, document structure, and the fundamentals of the web.

"I'll put in a plug for the language I use every day- Actionscript 3. it's very object-oriented..."


Gags aside, I did consider Flash in this context, but, yeah, no. Domain languages are not really going in the direction I'm looking for yet. Maybe we'll do a Flash game as a summer project or something, but not at this stage of things where the focus is on fundamentals.
posted by majick at 5:14 PM on February 22, 2009

I'm late to the party, but I suggest you take a look at PLT Scheme. Very immediate, with an REPL and "staged languages" (they disable features for beginners so that the error messages are easier to understand), some graphics.
posted by Monday, stony Monday at 7:58 PM on February 22, 2009

Hmmm. Did you know about RealBasic? It's a cross-platform BASIC with a snazzy IDE. Not open-source, which I don't like, and it's compiled, not interpreted, but if you have a soft spot for BASIC you might like it.
posted by i_am_joe's_spleen at 8:25 PM on February 22, 2009

Have you considered one of the mathematical software environments?

I'd like a language and execution environment that is somewhat multiplatform, has graphics and sound support, uses a language I know or can learn relatively easily in order to teach,

Most of my experience in this area comes through MATLAB, of which there exists a good quality GNU implementation called Octave, but these are generally full blown programming languages that present you with a command line interface as well as extensive scripting and graphics support (I use multiple GUI applications at my job written entirely in MATLAB). The other ones I know of are R (GNU), Mathematica ($), and Maple ($). All have cross-platform implementations for Windows, OSX, and Linux, some for 64-bit OS's, Sun Solaris, BSD, HPUX, etc. These platforms are widely used from the classroom up through top research institutions and if you know another language you should be able to pick up their conventions very quickly, and most are specifically geared towards both students and researchers who do not necessarily have any programming experience.

and most ideally is procedural rather than OO

This is a false distinction. The antithesis of a procedural language is a functional language. Many procedural languages support object oriented programming practices, just as some functional languages do. It might be more relevant to consider whether you want an interpreted language or a compiled language, strongly typed or not.
posted by sophist at 1:30 AM on February 23, 2009

Isn't there an interpreted version of BASIC for the unix-like systems?

Perhaps I'm too old-school- the command line seems a better place to start with the basics.

What about BASH scripting and the like?
posted by gjc at 4:55 AM on February 23, 2009

The other ones I know of are R

I love R, but I would never suggest teaching it to a child.
posted by grouse at 7:13 AM on February 23, 2009

I'm late here, but am going to throw in an oddball one: Inform.

Positives in this context: it's platform independent. It gives instant feedback without a lot of mysterious syntax. Seriously, people are suggesting Java and C# as good first languages for kids? Have you people ever met kids? It doesn't look like a computer language, which could help suck in people who might otherwise be intimidated by the syntax. And it serves as what I think is an ideal way to introduce the concepts of object-oriented programming in a tangible, unintimidating way without too getting bogged down in theory right away.

Negatives: it's domain specific, only useful for writing zork-style text adventure games -- no sound or graphics. Its unusual, english-like syntax may make for a difficult transition to more general-purpose languages. I certainly wouldn't use it as the only language you teach them, but it might make a good first day get-used-to-making-the-computer-do-what-you-tell-it-to introduction.
posted by ook at 7:47 AM on February 23, 2009 [1 favorite]

I'm late, too, and may be completely off-base, but I think I get what you are trying to do, and I'm not sure why Scratch doesn't appeal:

Scratch is available as a free 35 MB download, and runs on both Windows and Mac OS X, with a Linux version currently in the works. The interface is divided up into several panels: lists of available programming operators and variables appear on the left-hand side, scripts, images, and sounds are in the middle, and the program itself is shown on the right. via

Scratch can also be used with the above-mentioned Lego Mindstorms, which is one area where middle-school kids can actually get into programming things that go, and so has that immediate gratification factor built right in, unless I am mistaken (I may well be. I frequently am, even. But my kid has done the Robotics thing--incidentally, when they get older, there are LOTS of scholarship opportunities if you follow this road).
posted by misha at 12:27 PM on February 23, 2009

Or is the entire concept of teaching fundamental computer literacy an obsolete one in the modern age of children surrounded by closed, sealed, consumer-oriented devices that are made by distant wizards?

Being surrounded by closed, sealed, consumer-oriented devices made by distant wizards is not going to make it any harder for you to teach your kids to program using any toolchain you personally feel comfortable with. What it will do, though, is increase their own resistance to the idea of programming as something worthwhile in its own right.

I first encountered personal computers in my last year of high school (1979). For a couple of years before that I'd been deliberately ignoring them; I saw them as over-hyped, large, clunky calculators and absolutely couldn't see the point. To me, at the time, radio and TV circuitry was where it was at, and all this digital stuff made out of circuit diagrams full of mystery meat symbols that didn't even show you where the transistors were just left me cold.

It wasn't until I actually started messing about with a Commodore PET that was on display in a city department store that something clicked.

20 PRINT "HELLO, "; A$

Now that was a seriously cool toy. And my friend Chuck and I ended up spending every spare hour playing with that machine in that store. We took our own tape cassettes with us to save our stuff on, and we didn't stop until one day the sales guy told us that the machine was unavailable for us because "the cursor was broken". At the time I just wrote him off as a clueless idiot but looking back I think his manager might have tasked him with clearing away a nerd infestation.

The year after, Dad bought me an Apple ][+. I still have it. It still works. I also have an Apple IIe (with lowercase! and a numeric keypad!) sitting on a bench in the front room in case little ms. flabdablet ever wants to play with it for the same reasons I used to play with ASR-33 Teletypes.

The late Seventies and early Eighties were a bit of a golden age for kids learning programming. I started in 1979 at 17; most of the hobby programmers I know also started about then, at whatever age they happened to be about then. I know people who started banging out little BASIC programs, in about 1983, at the age of eight. I also know people who started messing with little computers as teens in about 1975. It seems to me that spontaneous interest in programming for its own sake was a reflection of the tech available at the time, which really didn't do anything until you did program it.

Kids These Days are completely swamped with interactive tech. They don't have to program their computers to make them interesting - they're too busy playing first person shooters on them or texting their friends with them or making irritating repetitious car-starting noises or baby-crying noises or whatever. It's got so that the default assumption is that a toy will be electronic and interactive. I gave my little niece a cuddly fluffy furry animal toy for her fourth birthday; she looked at it, pressed it all over, prodded it, poked it, turned it upside down, shook it, then looked at me in absolute bafflement and said "What does this do?" and I died a little.

The flip side of pervasive and competent toy tech (in which class I definitely include stuff like the iPhone) is that the difference between what a kid can accomplish in a few hours' hacking and what they see the commercially available stuff doing with no effort on their part is now absolutely vast. Today's software is insanely complex. The chances of any kid encountering some gadget that wasn't built by a team of at least Hollywood blockbuster proportions is really very small. Kids know this. For most of them, programming is now something distant armies of geeks do, not something a kid should properly be interested in.

Having enjoyably invested so much of my own life in learning how to make technology jump through hoops for my own amusement, I am also naturally keen to pass some of that enjoyment on to the next generation. I look forward eagerly to the day when one of them shows a glimmer of an interest. Once that happens, I think my first teaching task will be showing them how to get stuff done with bash in a Terminal window - because writing little scripts that automate tasks that would otherwise involve endless irritating clickery is something that a moderately clueful kid could see that they might be able to learn to do without needing years of training and an army of co-workers, and because the command line is the literate way to control a computer.

HELLO, STEPHEN is just not special any more, and I really don't think there's any way at all you could persuade any randomly selected modern kid that it should be. If you're going to get a kid interested in programming, you need to find something the kid can't currently achieve without it. Best of luck with that, and I mean that without even a trace of snark.

On preview: yes, something involving robotics is probably going to be your best way in. Commercial consumer-grade robotics is not yet pervasively competent.
posted by flabdablet at 2:44 PM on February 19, 2010 [1 favorite]

« Older What is the fastest USB flash ...   |  How much do criss-crossing ele... Newer »
This thread is closed to new comments.