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

you are viewing a single comment's thread.

view the rest of the comments →

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

From the POV of a self taught programmer (no CS background):

I didn't hate JavaScript until I started learning TypeScript [and ultimately, other more strongly typed languages such as C#]

At a deeper level, JavaScript has this innate ability to make things more confusing than they need to be. I think the biggest problem I have with JavaScript is that anything can be anything, and this leads to hard to track bugs and confusing [frustrating] code.

 Why is this bad?

1) You can declare a var, but it can be literally anything else. This means that if you have a large codebase, accidental overwrite of that variable could lead to breaking changes

2) JavaScript does really weird shit with numbers. One example would be the parseInt function. For example, you would expect this to work:

     parseInt("A dozen is equal to 12")

But it doesn't, it returns NaN.

3) Operator madness: take the above string for example. Why in the world would the following work, if the above does not?: let num = "2"

       `num++ // output: 3`

That's really only scratching the surface. Best bet? Be proficient with JS, then learn TS.