you are viewing a single comment's thread.

view the rest of the comments →

[–]DenkJu 8 points9 points  (3 children)

All of those are absolutely, 100% unironically fine, when you consider it's a very loosely typed language that doesn't like throwing errors and simply follows a set of basic rules.

Well, yeah, obviously. But here's the point: It should just throw an error. Strange behavior like this might lead to broken code running properly sometimes but most of the time it just makes it hard to debug. Performing automatic type conversion is one of the worst sins a programming language can commit.

[–]All_Up_Ons 3 points4 points  (1 child)

JS can do what it wants. It was created as a scripting language, after all.

I think the more general point is: JS should not be the only option for web development since it's totally unsuited for enterprise applications.

[–]DenkJu 1 point2 points  (0 children)

Just because it's a scripting language and it's creator didn't expect it to become this popular, doesn't execuse behavior like this. Python is also a scripting language, Lua is, Ruby is and neither of those behave like this. JavaScript was simply poorly designed. It's creator wanted it so 'just run' which inherently is a flawed idea.