JavaScript Beats Python

As Best First Language

Modern JavaScript (since ES6):

  • Is the most ubiquitous
  • Has greater adoption
  • Provides broader application
  • Enables clean functional paradigm
  • Allows sensible object-oriented paradigm
  • Runs on back and front ends
  • Is fastest of non-compiled languages
  • Has a solid package management system
  • Allows easy distribution and installation
  • Can be strictly typed (Typescript)
  • Can be embedded
  • Supports anonymous functions
  • Now supports native modules
  • Has solid frontend widget/graphic libraries (React)
  • Highly active development community
  • Uses operators and constructs similar to other languages
  • Has isolated (and mostly removed) the “warts”
  • Is not subject to breaking change schisms

It takes a very astute connoisseur to appreciate the finer reasons for picking JavaScript over Python (functional and OO paradigms both fully supported). The great irony is that modern JavaScript supports the approach MIT has been using for decades (more Scheme/Lisp-like) much better than Python and yet MIT moved to Python for beginners (unlike Stanford on JavaScript, which is so dated, Backbone.js? jQuery? AJAX? No fetch? No React? Crockford and Resig for textbooks?). To be fair, MIT picked Python long before the monumental ES6 changes that have reached world-wide adoption in record time.

But even to those with basic computer science background the other points are glaringly obvious to anyone really looking honestly at the comparison. Unfortunately the status quo establishment is only now coming around to considering Python as first language (most are still stuck on Java 😖).

Keep in mind that I have been teaching Python at SkilStak and beyond for more than five years. Python will remain an important language for a very long time and therefore remain, but it will be last. Beginning this Summer SkilStak will officially cover languages in the following order in our Introduction to Modern Programming course:

  1. JavaScript (functional -> stateful -> procedural -> soop)
  2. Go (focus on types, structures, and object-less methods)
  3. Python (imperative, blocking, comprehensions, generators)

We save Assembly (for Microchip PIC controllers), C/C++, Haskell, Clojure, Erlang, and (the obligatory) Java for later.

The thing I love about JavaScript the best is that I can teach it in much the same way as MIT used to teach functional programming (zero side effects). In fact, where most begin with assignment in their first lesson or so, we will save assignment until after functions (the first and most rudimentary occurrence of state). In fact, functions are the first thing I am putting into the new course. Then, I plan on “apologizing” (as Uncle Ben calls it) for assignment and state and describing why they are completely and totally necessary to modern programming.

I plan on drawing a contrast to the academic obsession with functional programming and enterprise obsession with object-oriented (stateful) programming. After all, the killer app that got people to use PCs was a highly stateful application (Visicalc spreadsheet). It is not that one or the other is better, both serve humans in different ways with different needs on different hardware.