Google Dart: The Web Developer's Dream? | Nashville Web Development & Design
Posted by Brady Mills

Google Dart: The Web Developer’s Dream?

October 17, 2011

Google seems to be dominating our posts lately, because of all the new and innovative things they are doing with social media, search and now web development.

Google DartThere has been much hype about Dart, the new client-side web programming language from Google, for some time now. Aimed at replacing Javascript, which is often seen as “fundamentally flawed,” Dart has been described as a “Javascript Killer.” Just last week Google debuted Dart at the annual GoTo conference in Aarhus, Denmark.

Some may recall Google’s attempted “java killer”, Go, from not that long ago which seemed to lose momentum after it’s debut. Go is more closely aligned with C & C++ languages than Java, because it is a classic compiled language which outputs binaries as processor-native machine code.

Google Dart on the other hand is a VM-based language that seems to have much more in common with Javascript than originally anticipated. Dart is not only intended to run in the web browser though, it’s also able to run on servers via a standalone VM. Still though, most Dart code will be client-side, and for the time being the way to run it is to compile it into JavaScript code that can be executed by modern Web browsers.

While Dart may be a “middle-man” since is essentially outputs Javascript code, the benefit may not be immediately obvious. The answer though lies in Google’s description of Dart as a language for structured web programming. This is something we’ve never really had before. Javascript was originally built to add small pieces of interactivity to web pages and has evolved over time. It was never intended to build full-scale modern web applications. Dart is intended to encompass all of the great things about javascript while addressing the not-so-great things.

For example, Javascript allows you to treat a numeric string as an integer and perform arithmetic on it. In a large scale application, it is very easy to lose track of which variables are of which type, leading to data corruption and hard to trace errors. Instead of limiting flexibility, Google decided to simply make debugging easier.

Declaring data types in Dart is completely optional; however, if you define data types, Dart generates compile-time warnings (not errors) alerting you of potential problems. You can also run Dart in debug mode which generates errors and halts execution at runtime if type conflicts arise. In this way you can speed up production while adding your type declarations later.

Dart also is written in object oriented style. This allows programmers from various backgrounds to more easily interpret and create Dart code. In true OOP style, each instance of each script has full control over it’s own state.

Google is taking a much needed stab at improving upon a 15 year old language (Javascript). I believe that Dart is certainly worth the attention of web developers, and we’ll just have to see if it has a greater impact than Google’s previous attempt with Go.

Written by Brady Mills

Brady Mills

Brady Mills is a dynamic group of developers, marketers and designers with one common goal … helping you succeed. We have helped clients create engaging websites and digital collateral since 2006. We have offices in Nashville, TN and Atlanta, GA.