Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I really don't understand why people hate JS so much. I myself a primarily a JS dev, and now a TS dev. TS made the experience so much so much better. JS is like pretty much a programming language for average software engineer like me. Sure, JS build system is a pain. I am the go to build system guy for almost every company I've been with, I worked with Grunt, Gulp, Webpack 1,2,3,4 and etc and yes I hate it, but other than that it works really well. If you don't touch frontend you can pretty much forget build system entirely. npm init is so easy.

Async is easy as well. I really don't understand the hate, what am I missing? Maybe I'm too dumb for other programming languages. I did try various languages from Java, Elixir, Haskell, Rust, Go, Ruby, Python and JS is simply the best in productivity, expressiveness, ease of use and performance balance.

As long as you don't code in a clusterfuck way, it is so easy to write JS and compose JS functions. Just use functions everywhere, no need class. JS is very readable.

Like, seriously, Python has Python2 vs Python3 package and build/deployment problem. Haskell is difficult and the tooling is abysmal. Rust is difficult and too much choices to just write this and that. Ruby has no tpe system and slower than JS. Python is also slower, no good async, and its type system is not expressive as TS. Go's type system isn't expressive enough. Java type system is too much and JVM is complicated. Scala is complicated.

JS/TS is:

- simple/easy to use

- pays the bills (you can go anywhere and find jobs as JS/TS dev in almost every company in the world)

- everywhere, like from IoT to robotics to game development to server to frontend to regular scripts

- easy programming language to do Leetcode style interview as well

- if you wanna do Option/Maybe style error handling like Haskell/Rust/Go you can do that with TS, just wrap try catch and return the error with neverthrow library. This makes TS programming bliss!!! I freaking love it

If you don't want to care about setting up NodeJS + TS, now you have Deno, who's pretty much out of the box everything just works.

JS/TS is such a super boring language it feels like cheating your way out of software engineering. It is a language made for dumb people like me, maybe that's why it has no appeal for hardcore programmers.

I owe to JS/TS on changing my life and giving me a good living.

Like, seriously I don't understand the hate...



I believe the JS criticism is more about the culture and ecosystem than the language itself. In short: Most if not all JS devs are more interested in playing with specific tools and APIs rather than dealing with and/or implementing programming patterns and principles. In the last decade "small modules" skyrocketed the popularity of NPM and a lot of people pushed the idea of "don't reinvent the wheel just 'npm install' everything" and sadly it stuck. Basically all JS-related discourse reduces down to "use X instead of Y!". It started with packages, then libraries, then frameworks, and now meta-frameworks – hell even meta-meta-frameworks if you count the people raving about Blitz. It's like that period when young devs couldn't tell the difference between jQuery and JS but way worse. So yes, in a way you are in fact cheating your way out of software engineering by installing neverthrow or whatever. I mean the language is already pretty damn high-level already.


What is a meta framework? This is the first time I heard this term.


I am thinking it is a framework that allows ease of interface with other frameworks, bundled up into one nice package/product?


Next.js, Nuxt.js, SvelteKit, etc.


I think a lot of JS haters haven’t spent much time with modern JS. That’s how it was for me, at least. I would laugh at JS wat-isms and think back to the old days of jQuery spaghetti. Python was my favorite language.

Now I’m a full time JS/TS developer and I love the language. It’s a dream to use. The syntax is concise and logical, the ecosystem is vibrant, and the barrier to entry is low. I wish there was more JS in the scientific, CV, and ML spaces — Python is still superior here, imo — but otherwise JS is my go to. It’s no wonder we see the rise of Electron apps - the developer experience is just so much better.


Right, you need some historical context to understand the situation. 10 years ago JS was a shitty language with a far worse ecosystem. It deserved the hate it got. Then ES6 came along 6 years ago or so and added tons of super valuable language features. Suddenly you don't have to deal with the hoisting semantics of var or worrying about what 'this' is all the time. It was so nice that people started using Babel to use the new features ASAP. Then a couple years later, once everyone has a transpiler in their build process without a second thought (this used to be controversial!), TypeScript comes along and provides another huge leap in how pleasant the language is to use.

Now it's a pretty nice ecosystem, but it used to be pretty bad. Not everyone's biases have caught up yet.


Same, I really want JS to have ML ecosystem like Python as well.


I don’t like JS and try to avoid it wherever possible. I have written some, but I’m not an expert by any means.

My problems with JS/TS:

Simple to start, but hard to program robustly and defensively. Due to the lack of typing, a lot of the codebases I’ve seen end up with extensive input validation code, which often uses fancy tricks that are hard to parse (unless you already know them). Typescript helps with this, but it is not the same as a proper type system because it is optional. Usually I run into runtime problems due to type errors with library code which doesn’t have types (or has the wrong ones).

The core language is filled with weird edge cases in coercion. jsfuck.com and https://www.destroyallsoftware.com/talks/wat are examples. This doesn’t affect my day-to-day code, but it’s equivalent to C undefined behaviour for me. A bunch of hidden rules that I don’t really want to extensively learn and understand, but which will bite me when writing anything moderately complex. ‘===‘ is good, but I think it’s really easy to miss the extra equals, especially if you write code in other languages a lot.

Lack of standard library (in Nodejs). For quick things, I find Python a lot better. The scant JS standard library has been widely criticised. This is a contributing factor to the absolute explosion in the dependency graph whenever you start pulling in a lot of the common dependencies. IMO, Go and Rust both do a better job despite having comparably easy package mangers.

Although some JS code is easy to read, I’ve seen lots of examples of overuse of functional indirection. Maybe it’s something I will start recognising the patterns once I’ve come across them more, I end up ragequitting JS codebases much more often than other languages. Despite its flaws, Go in a good editor is an absolute joy to understand new codebases.

I’ve found a combination of Python, Go and Rust to be the ideal combination. Each has its flaws, but for any specific use case, I can pick one I’d rather use than JS.


Like most languages, JavaScript has some landmines in it. The problem with JS as compared to other languages is that these landmines are plentiful in basic, frequently used operations, so it's easy to encounter all kinds of mysterious errors. If you know how to avoid them, you can mostly use it like a sane language and have a good experience. Hence "JavaScript: The Good Parts". Other languages don't really have a book like that.

A few of them are really hard to avoid, though, like the fact that JS has both "null" and "undefined", and these two values are sometimes treated as the same and sometimes treated as different.


Yeah I’ve seen really bad functional closures over the course of my career as well. But this just shows more of the developers’ skill than the language.

Btw it sounds like you might like Deno. Have you given it a try?


> functional indirection

Are you talking about point free programming here?


I guess that’s part of it. I don’t think the technique is necessarily a problem by itself, because it is often very easily traceable. However, it is annoying if the things being composed are not standard well-known functions, but user-defined ones.

A good example of what I mean is here (fresh on my mind because I was looking at it yesterday): https://github.com/FortAwesome/Font-Awesome/blob/master/js-p...

Somewhere this file defines an exported function called `icon`, but it took me way too long to find where and even longer to see what it was actually doing.

This might not be idiomatic JS code, but I’ve definitely seen other popular packages have similar code (especially internally).


Broadly agree - JavaScript and typescript especially are an absolute joy and delight to code with.

I use TS professionally, and it is my go-to choice for personal projects too.

Deno and vscode have brought an extra dimension of awesomeness - I personally never liked using npm (and therefore node) and try to avoid it.


I have done JS for several years and TS more recently. I think TS really fixes a lot of the issues that arise while building large systems in NodejS. But I think people are right to hate on the dependency nightmare that is npm. I could complain about several other things but really they apply to most popular dynamic languages...


> Async is easy as well.

An off-topic question: how do modern development practices using async code avoid race conditions and intermittent heisenbugs?


It's a great question. JS is single threaded (modulo web workers), which eliminates an entire class of race conditions: data races. That means mutices kan be skipped and channels can be replaced with a reqular fifo queue.

Async doesn't change any of this, and is mostly syntax sugar for callbacks. However, there are of course logical race conditions so when you use async you must be aware that the entire world can have changed after an await.


I like async. It's is easy to reason about. In what paradigm are race conditions avoided completely? I know Rust avoids "Data Races" but not race conditions as far as I'm aware.


I hate JS because I’ve tried Ruby. JS just feels unnecessarily verbose and noisy.


Interestingly Ruby was my first programming language but it was JS who made programming clicked for me. I think it is the curly braces. It helped my mind compartmentalize stuffs.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: