Why JavaScript

Learning to program in any language is awesome, but what language first? Really there are four I consider, Racket, Python, Ruby, and JavaScript. But my advice always ends up being: learn JavaScript, unless you are really motivated by another language, then learn that language first :)

Racket is an all inclusive educational dialect of Scheme. It is a very cool language with a slick environment for getting started, including great examples and tutorials. Racket is by far the smallest language on this list, which is a big advantage for getting started, but it also is the least popular, and least production focused.

Python and Ruby are wonderful languages. They fall in the middle of the scale of educational to practical. Both are some of the cleanest and clearest languages to read and write, and have a lot of resources that are good for learning. Python also has a large and robust standard library (they refer to it as batteries included, same as Racket), which has good documentation. While Ruby has a very active community of third party modules, including the Rails web framework.

JavaScript on the other hand has a kind of confusing syntax, there is almost as much bad advice on how to write it as there is good, and the standard library is tiny.

However, JavaScript is fun, and it's every where. It is the language of the browser, and thanks to the large number of competing implementations is crazy fast. It is an extremely practical language.

JS also has the most vibrant community of people independently making and maintaining modules and libraries. Since each one is small they are easy to learn about one at a time, and because there is no committee deciding what gets in, they pop up out of no where and iterate quickly. These things are also more likely to work together then modules in any other language. There are a lot of people in the JS community who have come around to the idea that these libraries should be like legos, and you should be able to plug them together in any way you want to build any kind of crazy thing you can imagine.

JavaScript is also far and away the easiest language to share the programs you have written. You can just put it in a web page. It also has an environment for systems programming, called Node.js, which is much easier to install and deal with dependancies and versions and library dependancies and versions then any other language (this is pain point in both ruby and python).

In the end there are no wrong answers for which language to choose first. The most valuable learning tools are motivation and support, so make a language choice to maximize those. And remember you aren't stuck with it forever.