Showing posts from November, 2011

Variables and Optional Types in Dart

Update : Reworked some of the optional types section based on comments. Intro Dart is a structured web programming language, complete with libraries, a virtual machine, and an editor. Dart is designed to help developers create more complex and feature rich apps for the modern web. In this post, we look at variables and their types in Dart. Variables The most simple example declares a variable without an explicit type: main() { var msg = 'hello'; print(msg); } > hello The most common way to declare a variable is to use the var keyword. This is truly a variable, as shown here: main() { var msg = 'hello'; msg = 'world'; print(msg); } > world final So far, this is a lot like JavaScript. Let's see what Dart can do differently. Dart allows you to mark variables as  final . main() { final msg = 'hello'; msg = 'world'; // ERROR: cannot assign value to final variable print(msg); } This all looks sim

Why Dart Excites Me


Transcription of A Quick Tour of Dart by Gilad Bracha

On November 2nd, 2011, Gilad Bracha gave a talk at Stanford University titled "A Walk on the Dart Side: A Quick Tour of Dart". I transcribed nearly all of the video so you can more easily skim and study the material.  Thanks to Dart News for pushing to YouTube. Learn more about the Dart language . (disclaimer, I did my best to capture what was said, any errors are my own) We’re talking about dart. It’s a new language we’re working on at Google. It’s really not my work. I joined the team the 3 months ago, but this project has been running for about a year. I’ve just started to contribute to this in any way I can. Overall, it’s the work of the Dart team, which is a fairly significant team. At 50,000 ft, the overall summary is that it’s a language for programming the web.  What is special about the web? In principle there’s nothing special about the web, but in practice there’s a lot that’s special about the web. And we’ve had an arguably had a regression in term