News for hackers. Stuff that matters.
Re:This will make some people mad (JS/Dart) by mythz on Friday September 12, 2014 @11:22AM (#8308492)
What land mines? Only `true` is true in Dart, everything else is false.
Re:This will make some people mad (JS/Dart) by yourad_io on Friday September 12, 2014 @11:24AM (#8308509)
Isn't this in sharp contrast to most other programming languages out there?
Re:This will make some people mad (JS/Dart) by jahewson on Friday September 12, 2014 @11:43AM (#8308646)
Java only allows booleans in conditionals, and it remains the most popular programming language.
Re:This will make some people mad (JS/Dart) by algorithms on Friday September 12, 2014 @11:45AM (#8308656)
I'd say so too. Many languages say that everything NOT false or null is true.
Re:This will make some people mad (JS/Dart) by kyrra on Friday September 12, 2014 @11:26AM (#8308522)
Numbers between DartVM run code and JS compiled code have different behavior[0].

[0] https://code.google.com/p/dart/issues/detail?id=1533

Re:This will make some people mad (JS/Dart) by mythz on Friday September 12, 2014 @11:34AM (#8308578)
Everyone likes to bring up this same issue each time which is rarely an issue in practice. Yes, numeric overflows have different behavior because of Dart's variable integers vs JS where all numbers are floats behind the scenes.

There is a VM and command-line `throw_on_javascript_int_overflow` flag that can be used to throw an error if there is any such overflow in your app.

Ideally when BigNums lands in JS this will no longer be an issue.

Re:This will make some people mad (JS/Dart) by JohnHaugeland on Friday September 12, 2014 @11:36AM (#8308588)
It's breathtaking when someone asks for examples, then discards the answer they get as too common.
Re:This will make some people mad (JS/Dart) by mythz on Friday September 12, 2014 @11:52AM (#8308708)
Things that rarely happen in practice aren't mine-fields. The only common thing in this issue is that it's brought up in every Dart thread, the actual issue of integer overflows is itself rare and usually an indication of a bug in your program.
Re:This will make some people mad (JS/Dart) by tomp on Friday September 12, 2014 @11:31AM (#8308557)
Exactly. And in the UK, they drive on the left. If either of these facts were the normal/usual/default, we wouldn't need to point them out.
Re:This will make some people mad (JS/Dart) by gecko on Friday September 12, 2014 @11:47AM (#8308676)
Is "string s = 5" still legal in Dart, or did they fix that? Last I heard, that worked by design.