Skip to main content

Teaching Programming to Children (pt.1)

In this 21st century more than learning how to operate Buck Roger's jet-pack of yore, programming will be an indispensable tool for children. I've been researching the easiest language to learn, mostly for my own benefit, but throughout I've kept an eye on what would be the best way to teach children programming.

I learned basic programming (with BASIC actually) in high school but was completely unprepared for a transition to college level programming and stopped there. So a few years back when I ran into a need for a very simple program, I found myself baffled at the few options to learn programming on the market for kids. It seemed that children were still being showed the equivalent of the LOGO turtle drawing vectors on a computer as if that was in some way preparation toward programming.

I scouted around and it seemed the only group thinking about how to teach programming to children at the time was the OLPC group which code almost everything in Python, allowing the children to get a the 'guts' of their computer and seeing or modifying how it works. I bought a Python book and tried to teach myself but found it not easy going.

Originally programming was simply a way of getting a computer to do something, and as such programming was optimized toward the computer not the user, since there was none, and not the programmer since he was almost certainly a computer engineer or expert herself (a lot of early programmers were women). Now, programming is used mainly to design software and interact with the user, not to run the computer hardware, but early programming languages reflect the original state of computing were saving computer cycles was more important than the programmer's time. These early languages were all procedural. That is they accomplished their goal in a linear step-by-step process. The most powerful of them is C, developed by Bell labs in the 70's.

In the 90's while I was in University a new type of programming emerged called Object-Oriented Programming. This rather confusingly-named programming has nothing really to do with real objects but with the way commands are structured. While before all commands were step by step, now you could make a command instruction a "property" or a feature of all the defined "objects" in the program. So instead of telling the program: store every key press the user makes in here and map it to this variable so I can access it later. I can just say something like "ObjectName.getstring" and the feature (or correctly called method) getstring that the ObjectName "object" posseses gets executed, the key presses stored in the "object" ObjectName. A little complicated but a very different conceptually from procedural programming and way quicker that writing the whole gop of step-by-step instructions to accomplish the same thing. The first popular Object-oriented languages were C++ and Objective-C (both of which are based on C), and Java.

Java is a very powerful language that is Object Oriented but has a feature that up to this point was only available in very weak languages, and that is it did not have to be compiled. (Compilation is the step where a computer language program gets translated into machine code.) In Java this happens on the fly or when you run the program, and it's handled by a virtual machine. Before, all code had to be written natively, for the machine it which it was going to run on. But with Java you could write it and run it immediately and on any machine that ran Java. Because of this, Java is called an interpreted language. Originally Java programs were super slow compared to natives, but as the virtual machine has gotten faster so have the Java programs. Java now runs on BluRays, Blackberries, Android and almost any PC.

But even Java suffers from the bane of learning most programming languages: a steep learning curve. Though the lack of compilation makes the writing more interactive, (you can find what works and what doesn't way quicker than before), it still takes a long time before you can make sense of Java (all those parenthesis and semi-colons... BASIC had none of these..!).

Up to this point most computer languages were designed by English speakers with an extensive background in mathematics (and I mean extensive, the renowned Princeton Math Dept. was not as mathematically inclined as the CompSci Dept., I understood what the math guys said some of the time). Java programming can look like a broken language spoken by a calculus teacher stuck in robot-like never ending run-on sentences. (Another semicolon! When does this statement end...?)

A couple of languages have come that operate in a similar way to Java, but with lighter frameworks meant as a way of adding small programs here and there. These are called scripting languages. Javascript and PHP are scripting languages. Some scripting languages like Perl became full fledged programming languages. Languages that followed the Perl-model like Python and Ruby (called dynamic languages) are full fledged programming languages too, that like Java, are interpreted, object-oriented languages.

The first time I took a look at Ruby code I knew I'd found my language. Ruby was written by a Japanese guy and with the intent purpose of making programing fun. For the first time the programmer, not the user and certainly not the computer came first. I understood it even from just glancing at it, and from studying it, I finally got what a Object Oriented program (OOp) was. In all the Java, C++ and even Python books I'd looked at or owned none had explained OOp well.

Ruby is incredibly well geared towards learning because of its readability, power and softer learning curve. Concepts learned in Ruby can translate into other programs well. There are a couple of resources for teaching and learning Ruby available: HacketyHack! and Ruby4Kids which I've used and found great. But I'm surprised that there aren't more. Hopefully as more interest and more people learn Ruby (like myself) more resources will become available.

Ruby is also terribly useful (and future-bound) as I'll discuss in the second part.

Comments

  1. This is a nice article..
    Its very easy to understand ..
    And this article is using to learn something about it..
    c#, dot.net, php tutorial
    Thanks a lot..!

    ReplyDelete

Post a Comment

Popular posts from this blog

My Fake Resume

Inspired by the over aggrandized bio of Joseph Rakofsky I want to write my own. If you don't know who he is; Joseph Rakofsky is a lawyer who earned a mistrial for a criminal client due to his (alleged) incompetence as reported on the Washington Post . There has been quite a few commentaries on his "Streisand-house" approach of suing all the bloggers and even the Washington Post and American Bar Association for reporting his (alleged) ineptitude. ("Streisand-house" is what happened to Barbara Streisand who wanted to have a picture of her mansion removed from the internet and she sued to have it removed. Unfortunately suing requires the filing of public documents with a picture of her house. The lawsuit had the direct opposite effect it intended. Everybody now could see legally, since it was a public document, a picture of her house.) But all that internet gossip aside I'm most impressed by his resume. Here is a quote from the website: Prior t...

Setting JRuby to run in 1.9.2 mode by default

JRuby comes with both 1.8.7 and 1.9.2 (currently) and the default is 1.8.7. If you want to change it you have to feed an option at the command line: $jruby --1.9 This weekend I had to migrate a rails program that I hadn't written and the author used 1.9.2 notation so it would not run on JRuby with the default settings. So I had to add the version option with every command which gets old quick. I looked online for a way to make this automatic (and on my JRuby books) but could only found the way to do it on a Mac or Linux but all Windows references just mentioned nebulous concepts such as environmental variables and seemed to be different from which version of Windows you are using. Here is how to do it. Windows 7: Got to Control Panel, System. Wine (Crossover 10): Java 6 version 21 will run on Wine (at least on Crossover 10) and you can install JRuby on top of that. To set environmental variables you have to go to regedit and set it there manually. Follow th...

Coca-confusion, it comes and goes...

Recently Latin American countries have voiced their opposition to prop 19 (it would legalize recreational marijuana use) because it will cause confusion. This is hogwash. While it might be a little curious to a Columbian that he can go to jail for growing pot while a Californian will not; it's no more confusing than a Bolivian growing coca legally and a Californian not. Wasn't Evo Morales a coca grower? Legalizing Marijuana if anything will lead to less confusion not more.