News for hackers. Stuff that matters.
Re:Dart programming language design by quink on Saturday April 14, 2012 @07:37PM (#3842294)
> 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.

Re:Dart programming language design by tomjen3 on Saturday April 14, 2012 @08:12PM (#3842360)
How 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.

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 ==.
Re:Dart programming language design by ams6110 on Saturday April 14, 2012 @09:20PM (#3842455)
There are probably as many if not more idiosyncrasies with any programming language.
Re:Dart programming language design by quink on Saturday April 14, 2012 @09:33PM (#3842472)
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.
Re:Dart programming language design by twerquie on Tuesday April 17, 2012 @09:00PM (#3855881)
> The way to convert a number to a string? Append a string.

You can always call intVar.toString() if it pleases.