Re:Dart programming language design
by anonymoushn on Saturday April 14, 2012 @08:24PM
(#3842378)
NaN !== 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 ==.
There are probably as many if not more idiosyncrasies with any programming language.
Bingo. 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.
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.