This will make some people mad (JS/Dart)
boustrophedon.github.io
boustrophedon.github.io
I'm no fan of Dart,but competition is good. Choice is good. If you dont like Dart dont use it.
Some people are wired to want the new thing while others will say "the old thing is good enough for me." Now it's just a matter of waiting to see if the new thing has enough new features to supplant the old thing. It took Java quite a few versions to gain traction. Remember how it was known for being "slow" for years?
And then this, it's not even the level of what you can hear at the coffee machine.
OP please don't metaphor in the shower. You're wasting the planet's water.
The patterns that Dart facilitate are just as easy to describe in JS.
// dart
var listA = listB + listC;
// js
var listA = listB.concat(listC);
That's just the tip of the iceburg. Overriding the [] accessor for custom list types opens up whole worlds of possibilities.So what are some examples of those things that would helper you write more concise code?
yea sure - almost nothing.
An entire thriving city has been built around the playground-over-minefield, and a fancy 6th set attractions is being built as we speak. It's right next to your door.
The nifty clean Dart-playground is still alone in a middle of a desert, waiting for a city to be built around it (and it's accessible via a tunnel dug from the middle of the minefield, if you like to get there quicker).
I fully acknowledge that this stack is the best we have when it comes to web applications. I fully acknowledge that it might take ages or even forever to get a better alternative than sweeping the ugliness under the rug and compiling from more sane platforms. But being the best solution available does not make it a good solution.
We once build a small cabin in the mountains in the '90. Now we are running a hotel with a thousand rooms in and on top of that cabin.
And what exactly is wrong with that? Looks to me like the hotel is doing just fine.
"Blub was never mean to do foo" is a statement that could be made with just about any language you can name.
I also think that while it's true that HTML and CSS were not originally intended for building user interfaces, the vast ecosystem that surrounds JS is designed to do just that (among many other things). It's not JS anymore; it's thousands of well-written libraries, some of which transform the way you write in the language itself (and I'm not talking about things like Coffeescript, but things like Underscore).
Except that Dart isn't type safe. And e.g. if statements treat most values as false. Plenty of mines still there.
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.
See, that's the really sad thing about JavaScript: it's a Blub.
In addition to JavaScript, I've written C, Python, Ruby, Perl, Go, C++, Java, Common Lisp, Scheme, HyperTalk, Visual Basic, Lua and shell (I'm probably forgetting something). I've played with Erlang and Haskell. Every one of those is better than JavaScript. Most are much better than JavaScript.
What are my issues?
Well, there's the whole hasOwnProperty hack when iterating over an object used as a hash table. Then there's the default variable scoping. Then there's == vs. ===. The default fallthrough in switch. The lack of integers. The goofiness of details of the object mode (I'm not objecting to prototypal inheritance; I'm objecting to the myriad subtly different ways to do prototypal inheritance). The lack of a metaprogramming facility. The lack of a standard package or module facility and its consequent explosion into a myriad subtly-different systems.
And there's the callback hell of the browser runtime, but that's not necessarily JavaScript's fault.
When I write JavaScript, I feel like I'm back in the bad old days of C, where a single error will be undetectable by the compiler and result in simply a core dump, leaving my to single-step through my code looking for what went awry.
If it weren't The Language of the Web™ it'd be about as popular as Befunge.
If something new come up, you find many articles about "the new stuff" and how "fun" it is, how "easy" it is and how much it make your developer life "better".
Nothing against motivition & enthusiasm, but your metapher fits like a glove eye, in most cases it is the Stockholm Syndrome.
The most "new" things just solve things only "different".
Literally every other concern, including language concerns, is second-order, negligible - and ultimately addressable.
What year is this?
If you think JavaScript isn't too that bad, you need to think about whether you're truly a programmer at heart.
If anyone/anything comes along and claims otherwise they will probably lash out against that. It would mean invalidating all the emotional investment (and real code and time investment) they put into it in the past.
-- a guy who built his career on JavaScript
One complaint I have heard about Dart is that the dart2js library outputs unoptimized JS. This is unfortunately an issue if we will not see the Dart VM implemented natively by the browser vendors.
http://news.dartlang.org/2013/03/why-dart2js-produces-faster...
For the record, I'm not against Dart - I wouldn't mind a new language being the norm that draws the good parts from JavaScript and other languages. New languages face an uphill battle though, from an adoption standpoint.
See advanced profiler and introspection tools to profile Dart Apps: https://www.youtube.com/watch?v=Ww8ISWzZGRE
From Kasper Lund showing advanced compiler tricks Dart2JS uses to generate highly optimized JS: https://www.youtube.com/watch?v=FqsU3TbUw_s
From V8 and Dart founders about why Dart is faster and easier to optimize: https://www.youtube.com/watch?v=huawCRlo9H4
Performance for each platform can be tracked at: https://www.dartlang.org/performance/
Every number is in 64-bit floating point. So if you want to do any number-theory-based crypto (Elliptic Curve) or you have do deal with numbers bigger than (2^48) you either have to study IEEE 754 very carefully (and likely push to production a series of mistakes), or take the hit of using an integer math library that has worked out how to do proper integer math with the 48-bit mantissa of a 64-bit float.
Of course there are those who don't realize this at all, and try to do integer math in JS, or in the case of a beginning programmer (many students start with JS these days), they don't realize that 0.1 + 0.2 == 0.30000000000000004.
Every variable is global by default. The best way to hide data in JS is within a function closure. However, one forgotten var keyword, and your whole encapsulation model is trashed.
In other words, often, those who do not understand but blindly repeat claims and advocate X to others (think of religious fanatics), will have a harder time overcoming cognitive dissonance and seeing that maybe there is something else better than X out there.
- 100% open source that includes open patent grants
- Has a language specification
- Has multiple compliant open source implementations (Dart VM + Dart2JS)
- Develops in the open
- Accepts external contributions
- Features are prioritized and driven by user feedback
- Encourages re-use and adoptionYou can compile Dart to JS, which you can then run vanilla on any browser.
There was no way to do anything remotely similar with ActiveX.
Calling "Dart" part of a walled garden doesn't make sense.
Deleted comment
I'd love to hear that someone is proposing that JS raise exceptions when you use mathematical operators on non-numeric data.
I really hope the Dart team succeeds. Their language has some problems, but nobody else working on the JavaScript Problem has both the motivation and the actual ability to challenge JavaScript's invincible monopoly on the web.