Why do a lot of people hate JavaScript?

Why do a lot of people hate JavaScript?
0.0 0

#1

I’m reading the YDKJS book series, and the author says at the beginning of the book that JS has received a lot of criticism. I googled it, and yeah it turns out to be true. Not only criticism, but a lot of people seem to totally hate the language and can’t wait for WebAssembly so that they can avoid it. I’m just a beginner to JS myself, but it honestly doesn’t seem that bad. Yeah it might have its issues, but in the books the author discusses ways you can be efficient in JS and avoid those issues. Moreover, with all the updates it’s getting, I think the language is a pretty successful one and a lot of stuff is being fixed.

I’ve read the language was designed in just 10 days, so that could be a reason, but even though, I still can’t see the reason many people hate it. Hoping to get some thoughts of more experienced people.


#2

There are only two kinds of languages: the ones people complain about and the ones nobody uses. Bjarne Stroustrup


#3

I used to hate the hell out of it years ago, then ES6 came and make it actually enjoyable.


#4

@Oxyrus So it’s not considered a “bad” language anymore? I’m actually rather enjoying it. I wrote C, C#, and Java before, and honestly I would have personally picked Java over JavaScript myself if I had the choice, but I don’t think it’s a “bad” language. It’s just different.

@h4m3d Lol. Yeah that makes sense, because I tried to also google “why do people hate java/c#/c++/python… etc” just for the heck of it, and it seems people hate those as well.


#5

There are still flaws, but many were addressed in ES6.

If you want to see a beautiful designed language check C# or Golang, you’ll realize what could be better in JS land.


#6

Yeah I’ve actually tried C# before. My plan for the long term is to learn Golang and Ruby, and get into Java more in-depth. I’ve read really good things about Golang. I might actually try it sometime soon. Do you think with WebAssembly we’ll be able to use those languages on the front end? I’m thinking it might be worth to start getting into them soon.


#7

I started learning Java myself :smile:. I wouldn’t learn wasm yet, it’s going to take a while to be widely supported, just like 2 weeks ago they said it was being enabled by default in chrome canary.


#8

Nice. As far as I understood though, developers won’t really be writing WASM, but rather it would allow them to use a variety of higher level languages which will be able to get compiled to WASM.


#9

Sorry, I meant the JavaScript API http://webassembly.org/docs/js/


#10

People just like to hate on stuff and form tribes.

Why do people hate Windows / Macs?
Why will someone claw your eyes out for suggesting you should use Emacs instead of Vim?

That’s just what we do.

On the point of JS being designed in just 10 days…that’s kinda misleading. I mean, people are still adding to JS today, and show no sign of stopping - so it’s had 2 decades of design go into it at this point! It’d be like attributing all of my achievements and quirks to the short time it took to conceive me, and not the 34 years since I was born where I’ve undergone some pretty significant upgrades :slight_smile:


#11

Javascript is considered bad language because it started out as a language which was built in 10 days and now tries to get all the best parts of all other languages. It creates issue of compatibility. ES6 is out, but you still have to choose when you have to use arrow functions or same old function syntax. Javascript is not time tested like Python, Ruby or Java. It’s constantly adding new features. We even use some features that weren’t even approved yet (thanks to Babel). Another major complain about JS is error handling where you have promises, closures and etc.

But the main issue for JS not being so liked is that the community moves really fast. Everyday new tool on npm, new framework, new way of doing/coding. For people coming from a backend languages like Pythons, Ruby or Java, this can be really frustrating. Also, you have npm compatibility issues when you update your packages.

I use JS a lot. But I can’t say that I like it or dislike it. I use it :slight_smile: Every language has its own place and as a developer you have to think which language/tool/framework to use on each occasion. Another real important factor is your satisfaction when you write your code. If you enjoy writing in JS, its fine and it would be best language for you. If you enjoy something else, then go with that (this is for backend, obviously you are stuck with JS for front end)

UPDATE: As an example, check out This article and comments on it.


#12

People often criticize things that they just don’t completely understand. Javascript is often misunderstood and even misused.
You can’t judge a crocodile by its ability to fly. The same goes about Javascript. Despite there being all this classy syntax sugar in ES6 Javascript is not an object-oriented language.
It also has some special behavior traits when it comes to type coercion. At first glance, it might look and feel stupid and illogical but once you’ve made it through at least some parts of YDKJS you start to realize that Javascript is a truly beautiful and almost limitlessly powerful language.


#13

:notes: Isn’t it ironic… :notes:


#14

Yes, it is. I was so captivated with emotions that forgot to add:class based. :slight_smile:


#15

Ok, so that’s why JavaScript is considered a BAD language for your new project:

  • Absence of stable and well matured solutions - longterm support is a headache :head_bandage:.
  • Every year there’s something new: Angular1.6, Angular2, Angular3, TS, PureScript, Elm. Newbies simply can’t keep up with such pace - entry barrier is growing and self-destructing over time which is frustrating.
  • You simply can’t afford rewriting everything from scratch each time something new came out, and/or when you’ve updated your dependencies and everything had stopped working for the reason unknown.
  • Prototype inheritance is a way to spagettize your brain neurons - there are not many people who really understands the difference between __proto__, prototype and [[Prototype]] :hammer_pick:
  • Node.js performance and overall JS performance is high compared to other interpreted languages, but compared to compiled ones, like Java / JVM based (Scala, Kotlin, Groovy etc), Golang, Rust, Swift node’s/JS performance is relatively poor :poop: . There’s a common misconception that if you’ll write a C extension and call it from Node / Java it’ll increase your performance, well actually calling a foreign function requires a lot of communicational black magic which comes with a huge costs. So Writting a C function for Java / Golang / Node.js with performance increasing in mind is a very dumb thing to do :disappointed_relieved:.
  • Quality Assurance (QA) is a big bump - there’s not much tooling to provide proper metrics and embrace some of the Quality Engineering (QE) processes.

So, backend-wise Node.js is not so efficient and not a longterm viable solution.
Frontend-wise there’s simply nothing else to pick from and you’re stuck with JavaScript for eternity.

Support costs are at least ten times higher then the development ones.

And that’s why JavaScript is a GOOD pick:

  • It’s common, every teenager can learn it in few weeks. Well, at least I’ve did :stuck_out_tongue: .
  • It’s the only browser scripting environment available and it has quite good performance.
  • There are tons of cheap work force, who are probably amateurs, but who cares as long as income and product value, even the illusory, grows, right ? :construction: Well, at least it’s an ignorant statement…
  • Node.js has the best tooling for frontend assets bundling / dependency management, and it’s a dumb thing trying to use build tools of other languages.
  • If you don’t really care about patents or how bloated your frontend can be, you can always go for React based frontend because it’s relatively simple and will be supported for quite a long time by facebook.
  • There’s MongoDB that fits well for the Node.js based backend project, and allows to not worry about the data redundancy, integrity and consistency… at least 'till things are falling apart.

If you’re going deep into the web - your only option is JavaScript with Node.js based asset processing.


#16

If you’ve ever seen a child struggling to learn something new, get frustrated, and throw a tantrum or yell, “I hate this!”, you’ll have a good idea why people write hate-pieces about JavaScript.


#17

Personally, I think Javascript is not good for beginner or education since it’s too flexible. Some languages such as Pascal, C or Object Oriented Language will work better.

Every lang has the advantages or disadvantages, someone loves and someone hates it. No matter what. It’s still so popular :wink:


#19

People hate JavaScript because they compare it to other things they have used such as C# or Java. I wrote both for over a year before I really started using JavaScript. At first I didn’t care for it, but I have grown to like it quite a bit (and more than C# in a lot of situations). Its flexible, and you can write very simple and clear programs. While C# and such lets you write much more elaborate and more “beautiful” code, in JavaScript I can use the same code on both the server and the client. And while modules I write in Node may not look as good as C# classes, well as it has been said:

Less is more. --Mies van der Rohe

More good code has been written in languages denounced as “bad” than in languages proclaimed "wonderful --Bjarne Stroustrup

A language that doesn’t have everything is actually easier to program in than some that do. --Dennis Ritchie

The cheapest, fastest, and most reliable components of a computer system are those that aren’t there. --Graham Bell


#20

People hate what does not be able to understand… So, Javascript is one of those things, I guess…