<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:foaf="https://xmlns.com/foaf/0.1/" xmlns:og="https://ogp.me/ns#" xmlns:rdfs="https://www.w3.org/2000/01/rdf-schema#" xmlns:schema="https://schema.org/" xmlns:sioc="https://rdfs.org/sioc/ns#" xmlns:sioct="https://rdfs.org/sioc/types#" xmlns:skos="https://www.w3.org/2004/02/skos/core#" xmlns:xsd="https://www.w3.org/2001/XMLSchema#" version="2.0" xml:base="https://www.linuxjournal.com/tag/dart">
  <channel>
    <title>Dart</title>
    <link>https://www.linuxjournal.com/tag/dart</link>
    <description/>
    <language>en</language>
    
    <item>
  <title>Dart: a New Web Programming Experience</title>
  <link>https://www.linuxjournal.com/content/dart-new-web-programming-experience</link>
  <description>  &lt;div data-history-node-id="1084577" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/11429f2.png" width="565" height="480" alt="" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/james-slocum" lang="" about="https://www.linuxjournal.com/users/james-slocum" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;James Slocum&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p&gt;
JavaScript has had a long-standing monopoly on client-side Web programming. 
It has a tremendously large user base, and countless libraries have been written in it. 
Surely it is the perfect language with no flaws at all! Unfortunately, 
that is simply not the case. JavaScript is not without its problems, and there 
exists a large number of libraries and "trans-pilers" that attempt to work 
around JavaScript's more quirky behaviors. JQuery, Coffeescript, Objective-J 
and RubyJS are examples of how people have been trying to make JavaScript 
better. However, a new contender is throwing its hat into the ring in a big
way.
&lt;/p&gt;

&lt;p&gt;
In comes Google Dart, a new JavaScript replacement language. Dart is a ground-up re-imagining of what JavaScript should
be. It requires its own runtime 
environment (which Google makes available for free under the three-clause BSD 
license) and has its own syntax and libraries. Dart is an object-orientated 
language with a heavy Java-like feel, but it maintains many of the loved 
JavaScript paradigms like first-class functions.
&lt;/p&gt;

&lt;p&gt;
So, why have I chosen to use Dart? Good question! I have chosen Dart because 
it is a clean break from JavaScript, and it has the object-orientated programming 
style I have come to know and love. Because I have a Java background, the 
learning curve didn't seem as steep with Dart as it does with JavaScript. 
Also, because Dart is so new, it gives me a chance to become an early adopter 
of the language and watch its evolution.
&lt;/p&gt;

&lt;h3&gt;
Installing Dart&lt;/h3&gt;

&lt;p&gt;
Before you can program with Dart, you need to grab a copy from 
&lt;a href="https://dartlang.org"&gt;https://dartlang.org&lt;/a&gt;. I chose to install only the SDK; however, there is an
option to grab the full Dart integrated development environment with the SDK
included. Eclipse users will feel right at home with the IDE, because it is based
on Eclipse components.
&lt;/p&gt;

&lt;p&gt;
To install the SDK, I just unzipped the files and copied the whole directory to 
$HOME/bin. Then I modified my path variable to look in the folder I created:

&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
PATH=$PATH:$HOME/bin/dart-sdk/bin 
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;
Now I can run dart, dart2js and dartdoc from anywhere.
&lt;/p&gt;

&lt;h3&gt;
Language Features&lt;/h3&gt;

&lt;p&gt;
The core Dart language is pretty straightforward. The basic data types 
available are var (stores any object), num (stores any number type), int, 
double, String, bool, List (arrays) and Map (associative array). All of 
these data types are declared in the dart:core library. dart:core is
always available and does not need to be imported. Functions also can be 
considered a data type, because Dart treats them as first-class objects. 
You can assign functions to variables and pass them as parameters to other 
functions or write anonymous functions in-line. 
&lt;/p&gt;

&lt;p&gt;
For flow control, you have the "usual" if, else if, else, for, while and 
do-while loops, break, continue, switch and assert. Exceptions are handled 
through try-catch blocks. 
&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/dart-new-web-programming-experience" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Tue, 07 May 2013 17:27:12 +0000</pubDate>
    <dc:creator>James Slocum</dc:creator>
    <guid isPermaLink="false">1084577 at https://www.linuxjournal.com</guid>
    </item>

  </channel>
</rss>
