Hacker News new | ask | show | jobs
by aragilar 1285 days ago
The moat for JavaScript is web-frontend, otherwise it would not be used (note the current rewriting of most of its tooling into non-JS languages). I would not call it beginner-friendly, stable, or good for quick scripts (does node come with sqlite?). I've yet to see a stable equivalent to django/rails. Javascript's data visualisation comes from it being in the browser, which has severe limitations (e.g. the need for WASM), and it's usually much easier if you don't need to two languages to do analysis (as the JavaScript numerical and data format ecosystem is a mess).

Python's advantage is apart from web-frontend (I have no expectation PyScript will catch on), it is everywhere, even when you don't expect it to be (e.g. Bank Python, VFX, Postgres, build systems, scripting interfaces in apps). Are there better options for specific usecases? Yes, but it's when these usecases intersect that Python wins out.

1 comments

> I've yet to see a stable equivalent to django/rails

... express? Has better benchmarks than both those frameworks, is probably more commonly used today (more employable), and has the benefit of TypeScript which fixes the biggest issues with both Python and Ruby (lack of a good type system)

> Python's advantage is [...] it is everywhere

Yes, that's my point. That's it's only advantage. But JS is better setup to become the "just use it because everyone knows it" language imo.

Having used express, and being shocked at how bad it is, no, express is nowhere near equivalent django/rails (flask, the go to microframework for Python, is more complete than express).

TypeScript has two major issues (which it shares with Python's type annotations): it has to interact with untyped code (so what you think it fine is not, especially when key libraries are not written in TypeScript), and it tends to increase barriers to modifying the code (unlike more functional languages, whose type system tends to be both complete and have less footguns).

As to JavaScript being more commonly used and known, that's dependent on where you're working (especially when it can be sandboxed off so that the majority of users don't need to deal with it, see plotly dash and R-shiny). I suspect having seen multiple examples of systems where JavaScript was used where it was entirely the wrong tool (and where for various reasons Python was the correct one, partially due to the difference in the library ecosystems), we'll see a slow retreat over time of JavaScript to its core areas (being front-end and server-side rendering of the front-end), as more people find that having two languages is a better choice, and rewrite/replace existing JavaScript services.