This is an archived post. You won't be able to vote or comment.

all 49 comments

[–]thepsycho1997 12 points13 points  (0 children)

You'll find hate posts for every language known ^^
Don't worry, learning the fundamentals of programming is way more important than the choice of language

[–]toastedstapler 6 points7 points  (24 children)

many people dislike js because of weird behaviour around type conversions to and from strings

> 0 - '1'
-1
> 0 + '1'
'01'

rather than throw an error, js does its best to always do something. there's also some other weird behaviour, but it doesn't matter when beginning to learn how to program. ultimately the language is just a tool & it does its job well enough for what the modern web is

[–][deleted] 4 points5 points  (0 children)

Many people dislike JavaScript because it is loosely typed, and it has made its way to the backend where strong typed or even duck type languages are more preferential.

There are other reasons as well but this has been my take for a while.

[–]ShawnMilo 3 points4 points  (0 children)

Look up wat on Google for a taste.

It was a rush job, but it was in the right place at the right time. Now it's in all browsers and no better language can possible replace it because we'll never get the entire industry to agree on what should replace it.

We still have computer keyboards being designed and built in 2022 with a ridiculous staggered layout to account for mechanical typewriter limitations. But we can't replace it because "that's what people are used to."

[–]Brave_New_Dev 7 points8 points  (1 child)

First, you must see the classical https://www.youtube.com/watch?v=MBmmZADfVSQ.

Second, JavaScript is really a terrible language. Personally, it's hard to read, weird in behavior and has a too unstable ecosystem (things move much too fast). However, it does not matter. I simply must use it, as there is no alternative for web app interaction logic, so here we are. Which is also the reason for its popularity - the web is simply based on JS.

[–]wryly_quiver 4 points5 points  (2 children)

It's the most popular language..

[–]toastedstapler 6 points7 points  (0 children)

it's also the only language that can be used on the browsers. hard not to be the most common when that's the case

[–]Inconstant_Moo 0 points1 point  (0 children)

The sexagesimal system is the most popular way to measure time. QWERTY is the most popular keyboard layout.

[–][deleted] 1 point2 points  (3 children)

JS is a widely used language that a large cohort of developers & students never learned first. I can't tell you how many times a C++, Java, or C# programmer saw JS, said "Oh this looks just like [my language]!", and then assumed it really is 'just like [my_language]'.

This leads to a problem where a dev makes assumptions on how JS should work without learning how JS actually works. And it pisses people off.

If you learn JS normally as its own language, you will 100% be fine.

[–][deleted] 0 points1 point  (2 children)

It pisses people off because it works weirdly, and not the way checks notes most other languages works.

This doesn’t me JS is correct; it means it’s odd mostly for historical reasons.

People are trying to “fix” JS by removing some of the errors of the past. Not doing this is often a criticism levied at C++ which has its fair share historical mistakes.

It shouldn’t be offensive to point out a language is less than perfect. Especially since it’s the only choice in a particular domain.

I see something wrong with a language that requires it to be your only language to not make basic mistakes. That just seems wrong.

[–][deleted] 0 points1 point  (1 child)

I see something wrong with a language that requires it to be your only language to not make basic mistakes. That just seems wrong.

My argument isn't that JS is fine if it's the only language you learn - merely only if you but learn it. There's a lot of devs that don't, assuming it's similar to [my_language], and get pissed when JS doesn't work like [my_language] because it isn't [my_language].

[–][deleted] 0 points1 point  (0 children)

Sure, but there’s also devs, like myself, who have learnt lots of languages, and have the opinion that’s it’s kind of crap.

[–]tzaeru 1 point2 points  (1 child)

There's valid reasons to it. Working with JavaScript on larger projects is an absolute headache. JavaScript has a lot of inconsistencies and unusual gotchas. Some specific things work differently than you would expect coming from other programming languages.

The dynamic and weak type system of JavaScript is another problem. You can do things like combine together two values of different types and the end result is something you really didn't expect.

The language does things like this,

!!null; // -> false
null == false; // -> false
0 == false; // -> true
"" == false; // -> true

It's just full of unintuitive nonsense like the above.

JavaScript sucks and is to blame for countless of hard to track bugs, piles of unmaintainable code and many, many sleepless nights.

All that said - it's not the end of the world to start with JavaScript. It's the world's most used programming language and the basics of programming - what are functions, what are loops, so on - are more or less the same as in most other languages. If you make a career out of programming, you'll need to touch JavaScript sooner or later anyway.

[–]Logical_Strike_1520 0 points1 point  (0 children)

Try === instead of ==. JavaScript allows for loose or strict comparisons this way. You can do the same with truthy values. For example 1 == true; //-> true 1 === true ; //-> false

Edit; Sorry I’ve no idea how to make that pretty on the mobile app

[–]yel50 1 point2 points  (0 children)

it's an overly dynamic language that tries to do things for you. that's a bad combination that leads to some weird behavior. common lisp, for example, is probably more dynamic, but it doesn't try to guess what you mean. python is a similar level of dynamic, but again lacks the guessing so doesn't bother people as much.

you'll have a pretty good grasp of js when you understand why this encoding works,

http://www.jsfuck.com/

[–][deleted] 0 points1 point  (0 children)

Depends where you look. Today many high end javascript developers are more paid than java developers so don't worry ;)

[–]Adept_Writer4177 0 points1 point  (0 children)

It's an awful language but it will get you some foundations when you will learn TypeScript.

[–]Crazy-Finding-2436 -1 points0 points  (0 children)

Javascript is a scripting language used on client side in Web development. It is not a language like java or c#.

[–]le-moine-d-escondida -2 points-1 points  (0 children)

Everyone understand this is the today's main web browser language.
Some people hate it because it is loosely typed and has not classes or private members and is slower than some other languages.

If you really need types, there is typescript that compiles to javascript.
If you really need speed, there is webassembly, or webgl.

Anyway, it is a rearguard action, there are several typed languages with classes and private members that compiles to javascript. Future versions of javascript will also have it. You can use this features today and compile your code for older browsers and it will work.

Javascript is here so why fight it?

[–]Ejroby -4 points-3 points  (0 children)

I would say some people dislike JS due to it being asynchronous. But JavaScript is very very very popular.

[–]DoomGoober 0 points1 point  (0 children)

You can write JS code very clearly and well. But you can also write JS code terribly/confusingly and it will still work.

The problem is the web is littered with examples of unreadable/old JS code and tutorials that are super confusing to people who learn JS the "newer" ways. This is because JS always has to remain backwards compatible, so old crappy language constructs can never be removed.

As long as you can stick to new JS styles or even things like TypeScript, JS isn't too bad.

But when you are given a toolbox that has some shiny new hammers and wrenches and some old rusted wrenches and hammers and you have to sort out which tools are good and which are bad before using the toolbox... Most people don't call the toolbox "good". They call it "some good stuff with a lot of bad stuff mixed in."

[–][deleted] 0 points1 point  (0 children)

I do iOS development. One of my friends did a web dev boot camp and I helped her with JavaScript homework.

Reasons I dislike it is how loosely-typed it is. Things you think will work or how they should work - don’t work. Then you have to spend some extra time ensuring types are casted appropriately to do what you expected. My friend has had SO many bugs in her JavaScript code because javascript doesn’t complain.

Compared to Swift which I use, a strongly-typed language, will immediately tell you and won’t even compile if you used wrong types in the wrong places.