Hacker News new | ask | show | jobs
by Grazester 3422 days ago
Javascript, really? Why not Python?
3 comments

That's a very good question.
How could you pass up an opportunity to use npm, browersify and webpack?
Compared to pip/pip3/conda/virtualenv, npm is very straightforward
Never heard of conda, and Python has been stable enough that I haven't (yet) ever uses virtualenv.
Final exam: Create a working webpack config by hand, on paper.
JS is the new lingua franca, what C used to be.

And unlike C it is easy to get started programming in it. Thus a good choice for an intro language if you ask me.

Learning to program is hard enough without having to worry about hoisting, truthiness, function vs block scope, prototypes, the many rules of this, "classes" that don't behave like classes, and other quirks unique to JS.

Do you need to know all of the corner cases in order to write a simple script? No. But good luck trying to get someone to debug a JS program without a solid foundation. JS is a pedagogical disaster.

A lot of these things don't matter to new people.

Prototype based inheritance vs class based inheritance will confuse exactly zero new people, since they will have zero prior experience with class based inheritance. Heck, if the goal is to teach algorithmic thinking and imperative programming (Stanford classes are 10 weeks long) then different forms of OOP don't matter at all.

Hoisting is weird, but is one of those things that can be worked around by teaching proper patterns and is no more mysterious to new people than whitespace errors in python or the magic word "static" in java or operator overloading in C++ or nightmarish type error messages in haskell.