What Coding Language Should My Pre-Teen/Teen Learn First?

September 5, 2017
Hansel Lynn

A Teen's First Coding Language

Parents who want their teens to learn to code are often curious what coding language their kids should start with. Python? Java? Scratch, Lisp, or something else? There are a lot of options out there, but our experience tells us there are generally a few answers better than others.

First, let's qualify the kind of students we're talking about. We're not necessarily talking about kids 10 and under - for the most part, those kids should be using Scratch, Snap!, App Inventor, or other drag'n drop language. We're talking about slightly older kids, about 10 or 11 and up, that aren't necessarily going to become a Computer Science major. In other words, it's most teens and pre-teens! With that in mind, let's get started.

Part 1 - What Does it Mean to Learn to Code?

There's a bit of a myth that learning to code is like learning a new language. Yes, there are different coding languages, and yes, it's all greek to a lot of folks who aren't coders. But unlike learning French or Mandarin, the most important aspect of coding is not the syntax. It's not about whether the word "computer" translates to "ordinateur" (French), or "dian nao" (Mandarin) - it's about how you put those words into a sentence. In coding, it's about *how* you string "words" together, and not the words themselves. In other words, it's about the logic.

In that sense, it doesn't matter so much whether your child is learning Python or Scratch, Javascript or Java, the logic is the same. Computers in the end, work the same way - you must provide logical steps for them to understand. Languages are simply different ways to give the same instructions to the computer. By understanding the logic of coding a language - any language - the student is understanding the fundamental way to code, which can be fairly easily translated into ANY language in the future.

Here's an example of two languages that count from 1 to 10 - Python and Java. The words are different, but the logic is the same - the "for" loops is a coding concept used in all languages. This example shows how to count from 1 to 10 - and if you look closely, you'll see that logically, they are both doing the same thing. The logic thought process is the same - it's just the words that are different. Learn one, and it's much easier to pick up the other.

Part 2 -What About the Language?

Part 1 was admittedly a little over-simplified. While it's true it's all about the logic, our experience shows there are some languages better suited as a beginner language. Those languages - you might have guessed - really allow the students to focus on the *logic* of the code, and not on the nit-picky syntax of the language.

Before we go on, it's interesting to note that there isn't a "right answer" here, in fact you may find this is a bit of a philosophical two-sided coin. Some folks (typically academia or hard-core comp sci) believe a more "hardcore language" like Lisp (for data structures or recursion concepts) or Java (for object oriented concepts) are better to learn early, as it helps cement fundamental computer science concepts. Fundamental as in real core Comp Sci degree stuff, low level how-a-computer-works kind of stuff. While there's a good argument to that, we don't think everyone needs to be a Comp Sci major, so we believe a step back to a common denominator makes the most sense. A common denominator that's useful for any career - plain old logic.

Speaking of plain old logic, there's nothing wrong with a 15 year old starting to learn code with Scratch, Snap!, or any other drag and drop language. In fact, one very powerful and even more basic way to learn is pure pseudo-code - basically logic written in plain English. While both are powerful ways to push the logic learning, in practice, we use these techniques more sparingly as kids get older because languages like Javascript and Python afford a closer experience to pure coding without hindering their learning at that age. That said, even a 25 year coding veteran like myself still has a ton of fun, and lots to learn, when coding logic games and programs in Scratch!

So let's go back to our example of the two languages from Part 1, above. Notice how Python is alllllmost readable as english text. For x (the variable) in a range of numbers, print "Count is 1", "Count is 2" and so forth. Pretty logical right? Now what's up with Java? You've got a public function with an array of args, a System.out.println, a static void main... Not the easiest to read is it? A lot of typing to do the same thing, right? While each of these are important concepts in understanding computer science, we feel instead these concepts become a distraction when learning to code (c'mon, admit it, it was distracting to you too, right?!)

We're in the camp that feels that kids tend to learn better when they're able to get things done quickly, build their confidence, and not be frustrated by distracting concepts early in their coding journey. If they have the desire to dig deeper, it'll always be there - but to start with a language like Java or Lisp, we've found, is typically more a hindrance than a help. It's something we've seen time and again at theCoderSchool, and has really become a part of our teaching philosophy.

So what camp do you fit in? Either way, pick a language and let's get our next generation ready! Learn to Code. Chang the World. ®