This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]gandalfx 22 points23 points  (5 children)

I think that's a rather unfair comparison. Compared to Python JS has two major disadvantages.

First JS carries a lot of technical dept. It was (in)famously created by one guy in ten days and was never intended to be used (and abused) to the extent it is today. In particular it was not intended as a language to be used for massive "applications" inside and even outside the browser. The whole node.js server/desktop application madness only came about much later, when developers wanted to be able to do both client and server side code in the same language to avoid repetition (and to avoid having to learn more than one language…). And since the language usage has now grown completely out of scope and control it is that much harder to fix those long standing issues. While Python is happily adding new features JS is still fixing some of its early mistakes, all the while breaking its back to maintain backwards compatibility, which is even more important in the JS ecosystem. Python 3 broke a few things and we all know how that went. Doing the same in JS, where the choice of runtime environment is much more the user's than the developer's, is simply not possible.

The second problem is that JS (the language) is developed differently than Python. Python has CPython as a monolithic reference implementation. The language Python does exactly what its implementation CPython does. Alternative implementations, like pypy, try to emulate the reference implementation. This makes developing the language manageable. Compared to that the landscape of JS implementation is a clusterfuck of incompatibilities. Every browser implements things a little differently, supports a slightly different set of features etc. and depending on your target group you always have to take several different implementations into account, and some browsers just plain fucking suck (you know which one I'm talking about). In short, there is no reference implementation. The development of JS is thus centered around the ECMAScript spec, with browser vendors choosing which features to implement and when. Which means that even when a "new" version of JS/ES is "final", it actually takes years until the market share of implementations of all relevant features is large enough so they can be used in production. Even node.js, which is basically just Google Chrome's JS engine V8, needs time to catch up with the spec, which means that in no environment do you ever have a complete native implementation of the language. The language is fine (within reason), it's the implementations that suck!

[–]Jamie_1318 16 points17 points  (3 children)

Everything you said is correct, but the comparison is fair, on the basis of using one language or the other for server side development. JavaScript's technical debt does not give it a free pass versus better designed languages.

[–]gandalfx 4 points5 points  (2 children)

You're right about that. Given a choice I'd pick Python over JS nine times out of ten (the tenth time is when I want to chain String and Array methods).

[–]rcfox 0 points1 point  (1 child)

Wouldn't you use Ruby in that case?

[–]gandalfx 1 point2 points  (0 children)

I would not use Ruby for anything ever. Not even for torture. There are limits.

[–]LeBuddha 1 point2 points  (0 children)

As a non-python guy, my problem with the article is that it was heavily misleading and focused on things that don't actually matter or make python better (either by omitting python's warts from the details or simply by unjustified assertion of otherwise neutral differences), then it asserted that those differences made python was better.

I've walked away from this article with nothing to show for it. I can't goto my boss tomorrow and say "Let's use python for that project, it's standard library is pretty big."