3 ms·
> Application programmers, unless they’ve committed serious crimes, should not be forced to deal with [JavaScript etc.]. > We’re not out to take JavaScript awa
by quink 15y ago
> Application programmers, unless they’ve committed serious crimes, should not be forced to deal with [JavaScript etc.].
> We’re not out to take JavaScript away. We’re not that stupid. I personally if I could I would, but Google probably wouldn’t.
I know it's cool to hate on JavaScript these days. But it just doesn't deserve it quite that much. And, wrong as that analogy may be, it smells like someone coding mostly in C++ talking about why C sucks.
- tomjen3 15y agoHow much Javascript have you written? This has dynamic closure. Everything else has lexical closure. Vars can be declared inside a block but it has no effect, because they are always scoped to the nearest function. Variables must be declared with var, or they will still work but they will be scoped to the global environment. Equality isn't transitive. NaN is not NaN. The way to convert a number to a string? Append a string. aString + aNumber = aString aString - aNumber = NaN etc.
- anonymoushn 15y agoNaN !== NaN is not a JavaScript thing so much as a floating point thing. === is transitive as far as I know, and you should have a pre-commit hook that prevents anyone from ever using ==.
- ams6110 15y agoThere are probably as many if not more idiosyncrasies with any programming language.
- quink 15y agoBingo. And it doesn't need anything as heavy as Dart to provide some nicely syntactical and automated sugar. CoffeeScript is quite enough and maps one-to-one with the generated JavaScript. It would be nice to have Python-style operator overloading in JavaScript, but I don't care that much, since it probably helps make JavaScript faster, for varying definitions of faster.
- twerquie 15y ago> The way to convert a number to a string? Append a string. You can always call intVar.toString() if it pleases.