Over a million developers have joined DZone.

Dart for Android: Why Google Should Embrace Dart over Java

DZone's Guide to

Dart for Android: Why Google Should Embrace Dart over Java

· Java Zone ·
Free Resource

Download Microservices for Java Developers: A hands-on introduction to frameworks and containers. Brought to you in partnership with Red Hat.

Google's programming language, Dart, has been around for a while now, but it hasn't quite taken off the way others have. It's not currently central to the way anything is done, and according to some, that shouldn't be the case. Cyril Mottier, for example, recently wrote an article suggesting a hypothetical sunny future for Dart: a starring role as the core programming language for Android.

Mottier presents a laundry list of limitations for Java as it currently stands when it comes to Android:

  • Outdated primitives types
  • The whole Google vs. Oracle fiasco
  • Google's lack of control over Java's progression

And that's just a few of them. The answer, Mottier suggests, may be to bring Dart to Android. 

He's not alone in this opinion, either. In fact, just a week or two earlier, Christian Grobmeier made a similar argument on his blog, describing Dart as something of an under-appreciated gem brought to the world a little too early, before it truly had a place it belonged:

Dart is great, but the browser vendors didn't ask for it. Nor did the hardcore JavaScript users. It is and will continue to be hard for Google to convince other people to switch from JavaScript.

Sure, you can do a lot of great stuff with Dart; like server side programming. But JavaScript has that all too. So why bother?

And the answer, Grobmeier says, is Mottier's as well: bring Dart to Android.

The argument is even more poignant now the Apple has released Swift, which Grobmeier sees as an analogous development. Swift is surprisingly similar to Dart, he says, and it's making him a bit jealous:

Now with Apple having a great, nice-looking and easy-to-use language like Swift ready for programmers, I think it's now the perfect time to bring Dart to Android. I am honest: being a long time Java developer, I will not miss Java that much.

It may not be a perfect solution, or a comprehensive one, though. Wolfram Rittmeyer, responding to Mottier's post, suggests that he is open to alternatives to Java - that seems to be a recurring sentiment - but takes issue with the idea that Google might embrace Dart so fully:

If there is one thing, where I didn’t agree with Cyril, it’s his paragraph, where he suggests that Dart could be the one language for all of Google’s projects. Such that Google could get rid of Python, Java, C++ and whatever else they use. I don’t think that’s feasible.

The problem, Rittmeyer says, is that a full switch to Dart would render vast quantities of Java libraries useless. Google certainly has the man-power and money to get around a hurdle like that, but it's still a major hurdle. Beyond that, most would agree that there is no single programming language that is the best for everything

So, unless you're pushing for acceptance of Groovy for Android instead, Dart as a Java replacement is an interesting hypothetical future. There may be a few drawbacks - or maybe a lot of drawbacks - but interesting nonetheless. What do you think? Could it work?

Download Building Reactive Microservices in Java: Asynchronous and Event-Based Application Design. Brought to you in partnership with Red Hat


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}