Skip to main content

Teaching Programming to Children (pt2)

The open source movement and the creative commons revolutions have brought a lot of power to regular people by sharing the underlying code and logic of programs and other knowledge. To take advantage of this freely available knowledge and to truly partake the power of open source, one must be able to code.

Thus began my search for good resources for learning to code, and for good resources to teaching coding or programming to children. This search led me to Ruby, a programming language particularly suited for teaching children code.

But why is Ruby so great? After all learning coding is like learning a new language, a time consuming and challenging proposition, and Ruby is not as famous or as popular as other languages such as Java. The answers lies in what you should teach to children.

Teach something fun to learn.

The first step in making learning fun is not balloons or clowns but a good learning curve. If the student feels his mastery of the subject increasing, it becomes more and more fun. Frustration, unnecessary complication and extremely long delays in gratification are things to be avoided. What you want is the student to feel that what looked impossible at the beginning quickly becomes easy and hopefully fun too.

Java is not exactly simple. Let's look at Java code.
"Hello World" in Java
It's not pretty. Here is the a simple "Hello World" program in Java. Typically the first program taught.
Can you tell what this does? What is a "public static void"? Sounds like something in a black hole movie; scary.


Now here is Ruby code for the same thing. Yes just one line.

"Hello World" in Ruby
A lot more readable, and way more fun to code. After a little looking you realize that "puts" may be short for "put string" or "output string." Frustration is reduced. Suddenly this complex programming thing appears attainable.

But here is the thing, this may appear simple but once you start grasping the concepts, it scales up in complexity and allows you to understand more complex languages like Java easier.
Can you tell what this does?
Additionally Ruby has a interactive ruby prompt (irb) that allows you to see in real time what a piece of code does and outputs. This provides instant feedback, provides instant gratification when you get it, and allows you to practice 'talking' in Ruby.
What's that 5 doing there? I don't know, but now I want to know.

Teach Something real world useful.

Many beginning programming languages like BASIC, Scratch or LOGO are so simple or limited that they're basically useless in the real world. They were in a way designed for the world of academia and that hampers their development outside of it. (There is Visual Basic, but that is neither free, nor able to play well outside Windows, thus not super useful. )

Ruby, on the other hand, is very useful right of the bat. It's a full-fledged programming language, not a simplified set of one. It can be used to code real programs that function in real-situations right now. It's also the basis of the web framework Ruby on Rails, that allows for speedy development of web applications. In fact, Rails is what has made Ruby popular this days. Ruby has many extensions, like graphic libraries, that allow you to quickly add functionality to your program without having to build it from scratch.

Ruby is actually used in real world applications. Twitter ran on Ruby (on Rails) originally and the User Interface (UI) still does.

Ruby is also very portable. That means it runs in many places, be it a web server, Windows, Mac OS or Linux. So what you learn in one place is applicable in many. Mac OS X even comes with ruby built-in. Unlike proprietary (company-owned) languages like Visual Basic, Ruby is open source, so support or development is not dependent on a company's whims or desires and can continue indefinitely.

Teach something future-bound.

In the ever changing world of technology it's important to look toward the future and see what's over the horizon. Ruby is a language moving forward. Not only is Ruby a good basis for other languages but also can be used for web development (Ruby on Rails), for simple Android and iPhone App development (Rhodes Framework) and with a version of ruby called MacRuby (the Scottish cousin) Mac OS applications.

Additionally, MacRuby integrates with Mac OS Xcode  and can be used as a spring board to learn the far more complex world of GUI programming with Cocoa. And MacRuby is not a second cousin, it's development has been officially supported by Apple and in some cases MacRuby code can run slightly faster than native Objective-C code.



Comments

Popular posts from this blog

Building my own home.

I've decided. I want to build my own home. There is something special about building your own things. I built a desk for my tiny room when I first moved to L.A. My room was so small that I had to sit on the bed to use the computer so I build a high desk so I could sit on the bed and work on the computer. My roommate Trentity helped me cut the ply-wood to the right side. I still have that desk. It now sits on the living room covered by a cloth hiding the surplus of costume parts my current roommate Sean uses in his creations. Learning to build and fix things continue. And the feeling of satisfaction from fixing even small things is great. So a few years ago I heard on the NPR program the Story about a couple of educators that moved to a tent in their back-yard so they could rent their house and afford to send their kids to college. They had a special type of tent called a yurt and cooked and showered in an RV they had parked next to it. I thought I could do that. Housing in Lo

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 t

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 to stud