Hacker News new | ask | show | jobs
by hutzlibu 1309 days ago
Well why do you hate javascript?

There are many languages that I do not like, but I hate none, so I am curious for the reasons of that strong feeling?

1 comments

No real standard library. You have the web API or the Node API to work with, and both are inconsistent.

The language is very permissive, making it not only easy to shoot yourself in the foot, but in the head as well. There is no easy way to say that your code is semantically correct because JS will allow it to digest anything. So, unless you do thorough review, bad code can easily get through.

Dependency hell if you're using NPM.

I'd be happy if the community was focusing on implementing some kind of default set of libraries, instead of adding syntactic sugar now and then on top of JS. I remember switching from Java to Kotlin, and the collection API was a real pleasure to work with. But in JS, everyone wants to use their set of libraries. Creating a starter project will get you hundreds of dependencies that you can never vet.

Well, I agree to most of the pain points, the ecosystem is a mess, due to history.

"The language is very permissive, making it not only easy to shoot yourself in the foot, but in the head as well. "

But I am actually not aware of much footguns of the language itself.

That is, if you stick with "the good parts" (even though I share not all the views from the book).

" Creating a starter project will get you hundreds of dependencies that you can never vet."

And it is possible to write clean vanilla js, or stick to limited frameworks. You have to maintain strict discipline though. And nowdays I would use typescript for a new project.

If we ignore all those pain points and ignore that we're sticking to "the good parts" and have to employ strict discipline and not rely on hundreds, if not thousands of unvetted dependencies and use typescript even though its type system has holes in it and nobody should mention the myriad build systems or varying APIs in browsers (its main target) or that its community can't come to an agreement on module formats/namespacing…

…and then I'll have no reason to dislike this language. Got it. Am I allowed to dislike the newish template literal syntax too?

You are of course free to dislike anything.

But you said "hate" before, which is a bit stronger than not liking.

The only time I came close to hating a language, was when I was forced to overtake someones half assed php project.

And I still do not like the syntax and have never touched any php code ever since, but I still do not hate the language, or its designers or users. I just avoided it. But hate has the vibe of wanting to destroy something ..

And well, yes, a nice clean start of the web would not be such a bad thing - if there would be some language or plattform everyone can agree on. Which is likely not happen and will just recreate the mess we have already.

There are degrees of hate. If we're talking about programming languages, then I hate JS, while there are languages I love. Who likes the experience of writing in Bash, for instance? It's ugly, limited, and has a series of gotchas, which is much like JS.

> hate has the vibe of wanting to destroy something

You may be right, and given half a chance…