beanz Magazine

What Programming Language Should Students Learn First?

brianza on Flickr

The choice of a first programming language can be overwhelming, from simple drag and drop to full languages.

Language matters. It shapes the way we see the world. It shapes the way we solve problems. It shapes our moods and dispositions, and it shapes the way we interact with others.

When parents ask me what programming language their child should learn, these facts weigh heavily on me. Should a student’s first language be simple or robust? How ‘low level’ should it be? Are ‘drag and drop’ editors the right way to start learning?

Python, Javascript, Scratch, Java, Ruby, C, C++, Objective C, Haskell: to anyone who may not have a background in software engineering, the number of choices can be overwhelming. Where to start?

Thirty-six years ago Seymour Papert wrote a book called “Mindstorms” that revolutionized the way we think about teaching programming. Up that point, code education focused on fitting students into preexisting frameworks to learn how to code. Because computers came with the BASIC language preinstalled — and that language dominated the professional programming scene — educators assumed that using BASIC was the default way to teach students how to code. It had few keywords, which they thought made the language more simple and straightforward to learn.

But Papert broke down this assumption: “Imagine a suggestion that we invent a special language to help children learn to speak. This language would have a small vocabulary of just fifty words, but fifty words so well chosen that all ideas could be expressed using them. Would this language be easier to learn?”

So where to start? The short answer to the question is that it depends.

Drag and drop editors like Scratch or Snap are great tools for younger students – anywhere from 6 to 13 years old. They’re powerful and introduce kids to core concepts of computational thinking – variables, functions, abstraction, looping, iteration, data types. They make code instantly accessible and get rid of many of the syntax issues that come along with coding in a text editor.

But at a certain point – I’d say the end of 9th grade, in general – using drag-and-drop editors just isn’t enough. High school students like their work to be based on the real world, and they feel infantilized if they’re still using colorful drag and drop code environments at age 17. They know – at least from perceptions of coding in popular culture – that programming does not happen with the mouse. It happens with the keyboard.

I love teaching Ruby as a first language for high school students. It’s a robust programming language that’s been used to power hundreds of thousands of web applications. Twitter and Airbnb were originally written using Ruby. Instantly, students know that they’re using a tool that is relevant and real.

Yet Ruby is also syntactically straightforward. Just as there are several ways to say the same thing in English, Ruby allows the developer to have some flexibility in the way that he or she chooses to solve problems. A perfect example: To find the length of an array, you can use the `.size` or `.length` method. Given the wider vocabulary afforded by the language, it’s easier to relate to and much easier to read. It’s is also whitespace insensitive, has great error messages to help with debugging, and avoids the syntax errors common of languages that use semicolons.

By no means is Ruby a perfect language. It’s slow, for one, and is not used as widely as C, Javascript or Java. But as a place to start, I’d argue that speed and ubiquity don’t matter so much. Once you’ve mastered the basics of Ruby, switching to other languages becomes much easier.

The opposing view is that we should start with hard, low-level languages like C or Java so that learning any subsequent language is easier. The main problem with this approach is that it turns students off from coding — it becomes too “math-y” and inaccessible early on, and this initial exposure will shape a persons view of code for the rest of their lives. We don’t start teaching math by throwing kids into multi-variable calculus.

Seymour Papert’s insights about choosing the right language are as relevant today as they were over thirty years ago. Parents should think carefully about how to introduce their kids to code in a thoughtful way.

Learn More

Upperline Code

http://upperlinecode.com

Ruby

https://www.ruby-lang.org/en/
https://www.ruby-lang.org/en/documentation/quickstart/

TryRuby.org

http://tryruby.org/

Learn Ruby the Hard Way

http://learnrubythehardway.org/book/

Coding for Kids Ages 5-8

https://www.kidscodecs.com/coding-kids-ages-5-to-8/

Coding Schools

https://www.kidscodecs.com/coding-schools-2015/

The Programming Language Doesn’t Matter

https://medium.com/read-write-code/the-programming-language-doesn-t-matter-659d71f3d759#.5a73dwnv0

Also In The April 2016 Issue

The iDTech summer camp recently posted 102 questions. Here are a few with links to the full list.

The choice of a first programming language can be overwhelming, from simple drag and drop to full languages.

REST is a standard way for software applications to work with each other to do things.

Blockchain software technology works as a distributed ledger to record what was done and when.

Believe it or not, computers and keyboards were not invented together.

Learn the basics of Go plus neat math details about Go and AlphaGo, the computer that beat a human playing Go.

If you were a wizard, wouldn't you want to know how to scale your spells for maximum effect?

— John Johnson

A phone and tablet app exposes the invisible world of radio, phone, and satellite waves that connect our computers.

ASCII is a set of letters, numbers, and characters computers use to communicate accurately.

Links from the bottom of all the April 2016 articles, collected in one place for you to print, share, or bookmark.

Computing at School (CAS) provides resources and support for computer science teachers and parents.

Interesting stories about computer science, software programming, and technology for April 2016.