- Dart is a programming language developed by Google that compiles to JavaScript and allows developers to write web applications using modern web development techniques.
- Dart aims to make web development simpler and more productive by having clean semantics, simple syntax inspired by C/Java, and allowing compilation to JavaScript for cross-browser compatibility.
- Dart is used by companies like Google, Soundtrap, and Montage to build web applications and is gaining adoption due to its productive development experience and ability to write code that scales from small to large applications.
21. #dartlang
Variable scope?
var foo = 'top-level';
main() {
if (true) { var foo = 'inside'; }
print(foo); // ?? What will this print?
}
top-level
Logical
No
hoisting
22. #dartlang
Scope of this?
class AwesomeButton {
AwesomeButton(button) {
button.onClick.listen((Event e) => this.atomicDinosaurRock());
}
atomicDinosaurRock() {
/* ... */
}
}
Lexical
this
29. #dartlang
Mixins
abstract class Persistable {
save() { ... }
load() { ... }
toJson();
}
class Hug extends Object with Persistable {
Map toJson() => {'strength':10};
}
main() {
var embrace = new Hug();
embrace.save();
}
Extend object &
no constructors?
You can be a
mixin!
Apply the mixin.
Use methods
from mixin.
43. #dartlang
Old 'n busted New hotness
<messages>
<message>
<subject>
Please fill out the TPS report
</subject>
<sent>2012-10-03</sent>
<summary>
I'm going to have to ask you to come in...
</summary>
</message>
<message>
<subject>
Reminder: fill out that TPS report!
</subject>
<sent>2012-10-04</sent>
<summary>
It's been 24 hours...
</summary>
</message>
...
</messages>
55. #dartlang
"Dart offers a sane and consistent development experience for modern web
applications."
- Blossom
56. #dartlang
"The source code for this game (Escape) is 20% smaller
compared to the ActionScript version (69.6 KB vs 86.5 KB). The
port took only 6 hours."
-- Author of StageXL