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.


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


Post a Comment

Popular posts from this blog

How to configure Ubuntu's keyboard to work like a Mac's

Typing accents on a PC is a complicated Alt + three numbered code affair. One feels like a sorcerer casting a spell. "I summon thee accented é! I press the weird magical key Alt, and with 0191 get the flipped question mark!" For a bilingual person this meant that writing on the computer was a start-and-stop process. With Mac's it a whole lot easier, just Alt + e and the letter you wanted for accents and alt + ? for the question mark. No need to leave the keyboard for the number pad and no need to remember arcane number combinations or have a paper cheat sheet next to the keyboard, as I've seen in virtually every secretaries computer in Puerto Rico.

Linux has a interesting approach to foreign language characters: using a compose key. You hit this key which I typically map to Caps Lock and ' and the letter you want and voilá you get the accent. Kinda makes sense: single quotation mark is an accent, double gets you the ümalaut, works pretty well. Except for the ñ, wh…

Contrasting Styles of Writing: English vs. Spanish

There is interestingly enough a big difference between what's considered good writing in Spanish and English. V.S. Naipul winner of the 2001 Nobel prize for literature publish an article on writing. In it he emphasizes the use of short clear sentences and encourages the lack of adjectives and adverbs. Essentially he pushes the writer to abandon florid language and master spartan communication. This is a desired feature of English prose, where short clipped sentences are the norm and seamlessly flow into a paragraph. In English prose the paragraph is the unit the writer cares about the most.

This is not the case in Spanish where whole short stories (I'm thinking this was Gabriel Garcia Marquez but maybe it was Cortázar) are written in one sentence. Something so difficult to do in English that the expert translator could best manage to encapsulate the tale in two sentences. The florid language is what is considered good writing in Spanish but unfortunately this has lead to what …

Fixing Autocomplete in Github's Atom Text Editor for Ruby

I really like Github's Atom Text Editor. I really like that it's multi-platform allowing me to master one set of skills that is transferable to all platforms and all machines. 

On thing that just burns me of the default set-up in Atom is the Autocomplete feature that seems to change my words as a type them. Because Ruby uses the end of line as a terminus for a statement you usually finish a word with pressing the return button and you get really annoying changes to your finished typed word a la MS Word. I find myself yelling "No that's not what I wrote!" at the screen in busy coffee shops.

I disabled autocomplete for a while but it is a very useful function. Then I found out they changed the package that gave the autocomplete to a new one called "Autocomplete Plus" that gives you more options. All that I needed to change to make autocomplete sane again:

1. Open Atom's Preferences
2. Search the bundled packages for "Autocomplete Plus"

3. Go to t…