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

Multiple Assignments in Ruby

In this Rails project I'm running I need to set a whole bunch of individual variables to 'disabled' at once depending on the group the current user belongs to. We can use multiple assignment in this case but with a caveat. Multiple assignments are a quick way of setting a lot of variables at once. h, k = 1,2  => [1,2] h => 1 k => 2 but   h, k = 1      => 1 h => 1 k => nil In that case we can do this: h = k = 1   => 1 h => 1 h => 1  Beware this sets them to the same object. So if you change one you change both. h = k = [] h << 1 h => [1] k => [1] While we're at it here is how to reverse two variables: h = 1 k = 2 h,k = k,h h => 2 k => 1

What Medieval Economics can teach us about tariffs.

As a teen, I used to play Dungeons and Dragons (D&D) with my friends. This started an interest in the medieval period that led to me taking a medieval history class in college just to understand the period more. Over the years I've also read great books like " Dungeon, Fire and Sword " about the crusades (I recommend the book) and yet with all that knowledge it wasn't until recently that it occurred to me I had a completely wrong understanding of economics in the Medieval Period. "Viking helmets, sword and footwear" by eltpics is licensed under CC BY-NC 2.0 In my D&D games, players who are adventures battling monsters and creatures would need equipment and on the trips to town, they'd get resupplied with their adventuring necessities. I'd run these moments referencing my imagination of what it must have been and fantasy books I'd read. There be an inn with a raucous bar, a gruffly black-smith, if a city also a weapon and armor sm...

Setting up the Marble Mouse for Ubuntu

I have a Logitech trackball which I love. I bought it when my wrists started hurting after hours of long Photoshop sessions. The switch to the trackball fixed all that. It allows me to hold my hand in the perfect position and it's great for most browsing with one exception: It lacks a middle-click wheel. This presents a bigger problem than it seems, as design seems to be removing the scroll bars at the edges of windows in favor of small slits. So to get around this you can emulate a scroll wheel or use the middle click to activate a scroll motion on various programs. Logitech has a utility that sets this up in Windows but in Ubuntu you have a better (if more hard-work required) option. The Ubuntu option is better because unlike in Windows you can emulate the wheel with the track-ball by holding down a button. This is the option I like to use. In Ubuntu you write a configuration file to set up the trackball to work the way you want it. I have to re-create this...