Best programming language for a tweenager to learn (Java vs. JavaScript vs. Python)

A Facebook Messenger exchange that might be useful to others … (edited out some of the shocking language!)

Parent 1: D [14 years old] is in Robotics and has to learn Java. Did they mean Java or Javascript? S [11 years old] wants to learn a language. Should it be Java or Python or Swift or something else?

Me: JavaScript and Node.js; Then he can do front end and server side.

Parent 1: [Professional programmer friend] said robots are not programmed in JavaScript.

Me: That will change.

Parent 2: Ok so no Java please. It is a formally much better language. But the simplest programs take pages and pages of code before one can do anything. The APIs are verbose beyond belief. I hate it. It is a language of an Enterprise software architect who doesn’t really code but costs $250,000 a year. Javascript ist truly a piece of s***. Inconsistent and dirty but the kids do not care – they can learn that quickly. There are a lot of good libraries for JS now. So I would agree with Philip that JS is a better choice. Python is probably close second, but no frontend then.

Parent 1: You said JS was s*** but then you said learn it?

Parent 2: I think Java will put him to sleep. And he needs to be able to tinker and experiment fast. You have to consider his age. My kids completed three programming courses in JS in Khan academy this summer. He should be spending as little time as possible on learning syntax. And as much time as possible on f-ing around with his code to learn design patterns so to speak. Like loops, how to find the largest/smallest number in an array using a loop. Without digging in documentation or using Max/min functions to set bounds on a variable that he is changing. JavaScript has an advantage that is has C-like syntax which is similar to that of Java. If he God forbid wants to learn it later.

Parent 1: So JS is s***and Java is worse?

Parent 2: Our general advice here is to learn one high level scripting language (Python or Perl, but everyone hates Perl now and one low level language like C++ or Java. But I just don’t think a teenager has patience to learn Java. I don’t think anyone who respects himself or herself as a programmer should build a career around JavaScript. But everyone has to know it.

Parent 1: Ok. Sounds like S should do python and D should do whatever his teacher says.

Parent 2: Consider courses available. The content and engagement in the course trumps language.

Parent 1: D has already started Java.

Parent 2: Ok, then Godspeed. Look up a hello world application in java. So, teacher what is a class. What does public mean. What is static void. This is seven chapters of a textbook just to say hello world. Including a f-ing array of strings as an argument. And a dot notation. What is System. What is out?

Parent 2: Teachers who start teaching anyone under 18 in Java are either idiots or are teaching a group of ultra-motivated MIT students Also try setting up an IDE and compiling this baby of a program. You will pull your hair out. Once it outputs hello world to console, your normal child will rightfully look at you in disbelief and think “who the f*** wants to do this every day”? Don’t get me wrong. My crawlers are written in Java. But it would be like watching a pornstar do an hour-long **** video, then trying it with your college girlfriend for the first time and wondering why it didn’t go the same way.

Parent 2: (Actually our crawlers are written in Kotlin, which is a script-like language built on top of java (compatible in both directions). The Russians developed it to make Java more bearable and increase the speed of development.)

me: Haskell if he wants to learn about computation, but JavaScript is the real world power due to libraries and APIs.

Parent 2: Perl IS still #1 in terms of libraries. Python and JS are catching up. Kotlin is like Python with Java power (which also has libraries for almost everything). Plus everyone has to know JavaScript. Python is cleaner and more logical, for sure. Their philosophy is anthetical to Perl: there should be only one way to do it. So they spend time fighting which function to keep. This is good for large socialist enterprises where everyone is a cog in the machine. So that mediocre programmers don’t get confused. I started teaching my kids Python and quickly ran out of energy. I then moved to Khan Academy and their JS based courses, which are about programming, and not JS per se. That was quite successful, but the difficulty accelerated very quickly and I needed to be behind them to give hints and challenge them at key junctions.

Parent 1: [another programmer friend] says Java is the new COBOL.\

Parent 2: Most computer nerds are wrong when it comes to how to teach programming. It has to be now taught just like mathematics: slowly, painfully, step by step to build foundations. Can’t get to cool or useful s*** quickly without several years of work.

Parent 2: in order to make a clone of Tinder you’d need to know: 1. app development for iOS. 2. HTTP server programming, 3. databases, 4. image storage and processing, 5. file I/O, 6. APIs. That’s at least two programming languages. SQL and a bunch of other s***.

Parent 2: One has to keep doing it. My buddy put his 2nd grader in front of Khan Academy and she went all the way to the end of the Javascript track. I asked him to test her after 6 months – she forgot nearly everything. She obviously retained concepts, but that was about it. That’s not surprising because adults are exactly the same way.

Parent 1: The thing is – they remember that they could do it. So it helps them later. I haven’t forgotten C programming because i did it for so many years. But I have forgotten iOS programming.

14 thoughts on “Best programming language for a tweenager to learn (Java vs. JavaScript vs. Python)

  1. Absolutely hated any higher level language as a teenager. Programming was only a means to draw fast graphics, rather than an end or a way to make money as taught nowadays. Assembly language was the only motivational language because it unlocked the maximum performance of the machine & it was less a contrived bureaucracy than raw physics. Languages like Swift are heavily dictated by bureaucracy.

  2. I have a friend who insists that kids should be taught to program in Java first because it is a wonderfully structured language that will teach them essentially all important programming language concepts.

    He also insists that kids in elementary school should begin math by learning complex numbers, and only much later be taught the degenerate case where the imaginary part is 0.

  3. No mention of Basic? What’s the world coming to?
    Elementary students enjoy “Scratch,” as it’s easy to create a simple game quickly.

  4. Python 2 or Python 3 though?

    The lesson here is to never, never, never, never, never, never be backwards incompatible. Never ever.

  5. Assuming the beginner isn’t hardcore like Mclionhead. (Me, I started with good old BASIC.)

    The language should probably be high-level and suitable for messing around. I have a weakness for Wolfram, but it might not be for everyone. Scripting or a language that doesn’t need recompilation to reduce distractions. Perhaps R for the future STEM student? (Except it seems like a terrible language.)

    Learning Java today is like learning Cobol back in the day, isn’t it?

    I thought Phil would recommend Clojure or something. Oh well.

    Finally, rather than starting from scratch, it’s probably better to give beginners a finished program and ask them to change stuff.

  6. I’d say Go, Python and Javascript by descending preference.

    That said, the learning environment is more important (I don’t hold much hope for the quality of the teachers, most are out of their depth). Programming on a modern environment like Windows, Linux or OS X, or even for the web is overwhelming with far too much extraneous detail to learn.

    I myself learned first with BASIC on an Apple ][, a much more compact and manageable environment. I think the modern equivalent is the Raspberry Pi, and you can certainly write robots in JS using a Raspberry Pi.

  7. Python has a library for everything and is easy to play around with. Kids could find examples for a lot of things they may want to build. Check out openai gym for old arcade games that can be accessed programmatically. Django for web and database stuff. This book http://automatetheboringstuff.com for all types of every day document processing automation code. IPython notebook / jupyter for playing around with python code interactively like matlab (or doing engineering homework in a few years before going to med school).

  8. For a kid, arduino perhaps? Hello world is compact, and it’s easy to make physical things happen which might be more engaging which is really the point, no? And for all you traditionalists you have to deal with 32k of memory and other vintage problems

  9. And there is a nice JavaScript control interface for Arduino too. 🙂

    The wars of the best universal language are so 1990s. When today’s teenagers enter the workforce in 5-8 years, there will be a new generation of programming languages. Just learn a Turing-complete language, familiarize yourself the fundamentals, and code up something cool. At 13, it does not even have to be all that practical.

    Kids get all the benefits of having so many choices and so few consequences. Just think Kavanaugh (sorry, off topic, but couldn’t resist).

Comments are closed.