dart: another tool in the toolbox
DESCRIPTION
I give an overview in dart and highlight the things I think are so cool about Dart. At the end I gave a demo of a web application using Dart and Polymor Web Components.TRANSCRIPT
![Page 1: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/1.jpg)
Dart Another tool
in the toolbox
![Page 2: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/2.jpg)
http://blog.sethladd.com/2013/09/forms-http-servers-and-polymer-with-dart.html
Client and ServerWe got both kinds, Client and Server!!!
![Page 3: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/3.jpg)
Who uses dart• Google - Fiber, Apps, Election
• Netflix - Security Monkey, integration with AWS
• Soundtrap - Music Recording with browser and WebRTC
• Blossom - Lean project mgmt tool
• SonarDesign - where Jesse works! :)
![Page 4: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/4.jpg)
How do I use it?• Run in Chromium Browser with DartVM
• Compile to javascript
![Page 5: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/5.jpg)
Language Features
![Page 6: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/6.jpg)
Data types• Num (base abstract type):
• int double (concrete types for num)
• String
• Bool
• List - no arrays !!
• Map
![Page 7: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/7.jpg)
Bool• Unlike JavaScript, 1 is not true
• True is true
• Everything else is false
![Page 8: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/8.jpg)
Strongly typed / Optionally typed
![Page 9: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/9.jpg)
Interpolation
![Page 10: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/10.jpg)
Classes
![Page 11: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/11.jpg)
Private, Getters/Setters
![Page 12: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/12.jpg)
Constructor
![Page 13: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/13.jpg)
Methods - Positional Parameters• optional parameters specified with [ ]
• defaults with =
![Page 14: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/14.jpg)
Methods - Named Parameters• named parameters specified with {}
• defaults with :
![Page 15: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/15.jpg)
name (x) => expression
Shorthand function
![Page 16: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/16.jpg)
Anonymous Function
FYI: fold is like inject/reduce in ruby
Use the shorthand syntax
![Page 17: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/17.jpg)
Generics
![Page 18: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/18.jpg)
Mixins
![Page 19: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/19.jpg)
Functional
http://www.infoq.com/presentations/dart-introduction
![Page 20: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/20.jpg)
Interfaces• Not strict, only warnings if you don't implement
all the methods
![Page 21: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/21.jpg)
Dart VM Modes
• Checked - annotations (int, string, etc) throw exceptions if given invalid data
• Production - type annotations are ignored
![Page 22: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/22.jpg)
Console Apps• import "dart:io"
• Can't use in web pages
• File operations
• synchronous
• asynchronous
![Page 23: Dart: Another Tool in the Toolbox](https://reader034.vdocument.in/reader034/viewer/2022051818/549c577aac7959dd2a8b46d0/html5/thumbnails/23.jpg)
Web Applications
demo