Dart; or Why JavaScript has already won

If you’re not into blog posts that state the blindingly obvious, skip this one. It explains why Google’s whole Dart idea will fail miserably as a “structured language for web programming.” Most people will have already figured this out by themselves, but for those few who haven’t, here’s why:

JavaScript is already there. On a couple of billion devices.

That’s it, really; there’s little else to say. Still, since a blog post is supposed to be longer than two paragraphs, I’ll say a bit more.

Every single browser (except for Lynx) currently deployed on a computing device contains a JavaScript engine. This goes way beyond the desktop, of course: of the billion or so mobile devices that will be sold this year, far more than half will have a browser, and thus a JavaScript engine.

(I wish I could be more precise here, but feature/basic phone OS breakdowns are notoriously hard to get, so I’ll leave it at “far more than half.” About 25-30% of all mobile devices are smartphones, and they all have a browser. Of the remainder many will also have a browser. I guess. I’m especially thinking of S40 and Opera Mini.)

JavaScript has become a de-facto standard: if you want to create something that just about everybody on the planet can see and use, you must choose JavaScript as your programming language.

Google wants to create a new language for the web. That idea will have to be accepted by all other browser vendors. Nowadays that doesn’t just mean Microsoft, Mozilla, Apple, and Opera, but also Nokia, Samsung, RIM, and a host of minor ones. Why would they do as Google tells them?

Google Chrome, the only browser that’s slated to support Dart in the near future, now has about 24% of the desktop market. Its desktop share is on the rise, but the desktop market as a whole is losing ground to mobile.

Then again, Chrome will be ported to Android in the medium term, and Android has about 20% of the mobile browsing market, though I expect that share to drop because most Android vendors will switch to another OS somewhere in the first half of next year.

Too many variables. Let’s say Chrome has 20% of the browser market. Thus Dart serves 20% of the worldwide market.

Remember VBScript, the language supported only by IE? At a certain point IE had 85% of the market, and still VBScript languished. Dart will suffer the same fate, only much faster.

From the announcement speech; at 9:13:

the competition is not JavaScript … We’re up against the fragmented mobile platforms

So in order to de-fragment mobile you first fragment it even further by adding yet another programming language?

Besides, how fragmented is mobile, precisely? If you want to write native apps it’s extremely fragmented, but Dart isn’t going to help there. No hint of a rumour about doing native development in Dart.

If you want to create web apps, though, you just create a web app and reach about 2 billion users. Sure, these users will use all kinds of different browsers, some of which will fail to render the app properly, or don’t support some features.

But Dart doesn’t help there. It’s not a browser, after all. It can’t even do CSS or HTML. Just JavaScript.

But never mind that. Let’s pretend that using Dart to de-fragment mobile makes sense.

Why isn’t there an Android version? Why wasn’t it announced for desktop and Android straight away? If your aim is to address mobile fragmentation it would have been nice to actually mention a mobile platform Dart’s going to run on, wouldn’t it?

My feeling is that Dart doesn’t have anything to do with “fragmented mobile platforms,” but only with the disdain that “real” programmers feel for JavaScript.

Enter the usual boring complaints: no classes, no other syntactic sugar, no nothing. Just powerful functions and object literals — but those don’t count because Java doesn’t have them. Only Java features count for determining whether a programming language is good or not.

This post sums it up (and it’s the best Dart breakdown I’ve found so far):

Hey guys!

I need to write a server-side program that does complicated business logic and database queries and stuff. Why can’t I use JavaScript? I demand JavaScript!

I don’t want that silly, ugly, badly designed public static main void nonsense, but just a clean, powerful JavaScript function!

Failing that, I demand a language that allows me to write Java programs in JavaScript, and I demand it now!

What about it?

No?

Then why do you demand the same, only in reverse?

If you want to work with the web, learn JavaScript. If you don’t want to learn JavaScript, stay the hell away from the web.

This is the blog of Peter-Paul Koch, mobile platform strategist, consultant, and trainer. You can also follow him on Twitter.
Atom RSS

I’m around at the following conferences:

(Data from Lanyrd)

Categories:

Monthlies: