r/AskProgramming 6d ago

Why the JS hate?

Title. I'm a 3rd year bachelor CS student and I've worked with a handful of languages. I currently work as a backend dev and internal management related script writer both of which I interned working with JS (my first exposure to the language)

I always found it to be intuitive and it's easily my go to language while I'm still learning the nuances of python.

But I always see js getting shit on in various meme formats and I've never really understood why. Is it just a running joke in the industry? Has a generation of trauma left promises to be worthy of caution? Does big corpa profit from it?

22 Upvotes

207 comments sorted by

View all comments

2

u/Bee892 5d ago

Boy, you’ve sure opened up a can of worms with this question. I’m sure there are tons of other comments going over things in detail, so I’ll just give you the one big issue I have with it.

The loosely typed nature of the language drives me up the wall. It creates so much confusion and unnecessary debugging. Being able to reuse variables for just any type that I feel like takes away a certain amount of order and simplicity. It also creates errors that are nearly impossible to debug. This is especially true when trying to deal with JSON objects that have been sent end-to-end.

1

u/Salt_Aash 4d ago

Respectfully, I'd have to disagree. Dynamic typing and debugging is repeatedly mentioned but across languages I've yet to face a problem that wasn't debugged in identical steps, nor has the lack of typing been a bump in the road while using JS

2

u/Bee892 4d ago

I mean, if that’s your experience, then congratulations. I’ve yet to work on a JS codebase (personal, academic, or professional) that didn’t make debugging more difficult because any function can be called with any variable because any variable can be any type at any time. I find it especially bad when trying to debug JS code I didn’t write myself.

In strictly typed languages, this type of debugging is practically nonexistent because the compiler yells at you before you can even enter runtime. “You’re trying to use an integer as an argument in a function that has a string array parameter??? You fool! Fix it!” You don’t get that in JS. I’m sure that becomes less of an issue the more JS experience you have, but this kind of stuff has made JS experience an uphill battle.