Am I the only one getting annoyed with these posts. Of course, when you do things like adding arrays, weird behavior happens. But how often do you write code that uses this undefined behavior.
The post isn't the problem as it is in ProgrammerHumor subreddit, where it belongs. The problem is people on both sides of the aisle who treat it as a serious attack of JS.
I think they're all fine as long as it's done in an origional way. This post just seems like a laundry list of all the other JS memes combined into one.
Probably not very often but you could have an issue if you use poor naming conventions and reuse of local variable names. If you mistype the variable identifier and don't notice, it's possible JavaScript's type coercion would make debugging a little more painful. All that said, it is kinda annoying to see posts about "omg you can do this thing that doesn't make any sense with JavaScript", like yeah we get it, JavaScript is weird.
Linters help but they're there to work around the weak parts of the language. Similar things are IDEs with good function name and argument order hinting for PHP. They do help you with PHP's inconsistent standard library function names and argument orders, but why is this a problem that exists in the first place? My opinion.
It's a problem because the initial versions of JS were so built-upon that changing the fundamentals of the language would result in enough backward-compatibility breaks to be undesirable. Languages which transpile to JavaScript are the current way of dealing with this, and in the future, languages will target WASM to allow for more ways of doing things.
That's fair enough, languages like Typescript do improve the experience significantly. I really hope WASM picks up, the potential to write any language in the frontend is really big after decades of little choice.
I think there is a serious philosophical debate underlying the memes. The question is should a language like JavaScript try so keep your code executing even when it doesn’t make sense. I personally think it should since it makes it much harder to find wired random errors. I prefer a system like Typescript that forces some type discipline.
View all comments
49
u/[deleted] Jun 21 '18
Am I the only one getting annoyed with these posts. Of course, when you do things like adding arrays, weird behavior happens. But how often do you write code that uses this undefined behavior.