SlideShare una empresa de Scribd logo
1 de 62
Descargar para leer sin conexión
#dartlang
2014-02-01
j832.com
Licensed under http://creativecommons.org/licenses/by-nc/3.0/us/
#dartlang
Me
Iowa
Microsoft
Freelance
Dart
Google
j832.com
#dartlang
✔ Improved productivity
✔ Increased
performance
#dartlang
Compile to JavaScript, runs across the modern web
#dartlang
#dartlang
Run Dart on the server with the Dart VM
#dartlang
require.js
Backbone
Backbone Marionette
jQuery
Modernizr
moment.js
dest templates
PhantomJS
Jasmine
Docs
Docs
Docs
Docs
Docs
Docs
Docs
Docs
Docs
"I just want to
write web
apps!"
"Hi, I want to
build a web
app"
#dartlang
Unit test
Dart SDK
Polymer
Intl
Packages
"Things are
consistent and
clear."
#dartlang
Apps start small, but grow and scale
#dartlang
Simple syntax, ceremony free
class Hug { Familiar
#dartlang
Simple syntax, ceremony free
class Hug {
num strength;
Hug(this.strength); Terse
#dartlang
Simple syntax, ceremony free
class Hug {
num strength;
Hug(this.strength);
Hug operator +(Hug other) {
return new Hug(strength + other.strength);
}
Operator overriding
#dartlang
Simple syntax, ceremony free
class Hug {
num strength;
Hug(this.strength);
Hug operator +(Hug other) {
return new Hug(strength + other.strength);
}
void patBack({int hands: 1}) {
// ...
}
Named, optional params w/ default
value
#dartlang
Simple syntax, ceremony free
// ...
Hug operator +(Hug other) {
return new Hug(strength + other.strength);
}
void patBack({int hands: 1}) {
// ...
}
String toString() => "Embraceometer reads $strength";
}
One-line function
#dartlang
Simple syntax, ceremony free
// ...
Hug operator +(Hug other) {
return new Hug(strength + other.strength);
}
void patBack({int hands: 1}) {
// ...
}
String toString() => "Embraceometer reads $strength";
}
String Interpolation
#dartlang
main() => print('Hello, World!');
#dartlang
Clean semantics and behavior
#dartlang
Clean semantics and behavior
● Only true is truthy
● There is no undefined, only null
● No type coercion with ==, +
Examples:
#dartlang
Missing getter?
"hello".missing // ??
Class 'String' has no instance getter 'missing'.
NoSuchMethodError : method not found: 'missing'
Receiver: "hello"
Arguments: []
Logical
#dartlang
String compared to number?
'hello' > 1 // ??
Class 'String' has no instance
method '>'.
Logical
#dartlang
Variable scope?
var foo = 'top-level';
main() {
if (true) { var foo = 'inside'; }
print(foo); // ?? What will this print?
}
top-level
Logical
No
hoisting
#dartlang
Scope of this?
class AwesomeButton {
AwesomeButton(button) {
button.onClick.listen((Event e) => this.atomicDinosaurRock());
}
atomicDinosaurRock() {
/* ... */
}
}
Lexical
this
#dartlang
Scalable structure
Functions Classes
Libraries
Packages
Mixins Interfaces
library games;
import 'dart:math';
import 'players.dart';
class Darts {
// ...
}
class Bowling {
// ...
}
Player findOpponent(int skillLevel) {
// ...
}
#dartlang
var button = new ButtonElement();
button.id = 'fancy';
button.text = 'Click Point';
button.classes.add('important');
button.onClick.listen((e) => addTopHat());
parentElement.children.add(button);
Yikes! Button is repeated 6 times!
Too many buttons
#dartlang
Method cascades
var button = new ButtonElement()
..id = 'fancy'
..text = 'Click Point'
..classes.add('important')
..onClick.listen((e) => addTopHat());
parentElement.children.add(button);
#dartlang
Inline initialization
parentElement.children.add(
new ButtonElement()..text = 'Click Point');
#dartlang
One of these things is not like the other
Object
Persistable
Hug
Hug is not
is-a Persistable
Don't pollute
your
inheritance
tree!
#dartlang
Don't inherit, mixin!
Object
PersistableHug Mixin
#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.
#dartlang
Context switching considered harmful,
Iterate quickly
#dartlang
Demo
Pop, Pop, Win!
#dartlang
#dartlang
700+
packages
#dartlang
Demo
New Dart Project + Packages
#dartlang
Compile Dart to JavaScript with dart2js
#dartlang
main Library
baz foo bar boo
imports
calls
baz
main foo bar
Tree shaking
dart2js
#dartlang
Our challenge ...
clean semantics and unsurprising behavior
without
extra checks when compiled to JavaScript
#dartlang
#dartlang
#dartlang
#dartlang
#dartlang
#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>
#dartlang
<custom-element>
Structure Behavior Styles
<div>
<input>
<p>
<span></span>
</p>
</div>
tag.verifyAccount();
<style>
p { color: red; }
</style>
Encapsulated
#dartlang
Reusable
Custom Element
HTML Page
import import import
HTML Page HTML Page
#dartlang
Data binding
Data model DOM Nodes
Data model DOM Nodes
#dartlang
ShadowDOM
HTML Imports
<template>
Custom
Elements
New web
specifications
Future proof
#dartlang
Polymer.dart
(today)
Using web components today
#dartlang
Custom elements everywhere!
<body>
<persistable-db dbname="game" storename="sologames"></persistable-db>
<game-assets></game-assets>
<game-app></game-app>
<google-signin clientId="250963735330.apps.googleusercontent.com"
signInMsg="Please sign in"></google-signin>
#dartlang
Angular is ported to Dart!
#dartlang
<div my-controller>
<div class="well">
<click-counter count="{{ctrl.count}}"></click-counter>
</div>
</div>
Angular and Polymer together
Polymer element
Angular controller
#dartlang
Dart in production
#dartlang
"Dart allows for quick prototyping as well as
robust code that is easy to refactor"
- Soundtrap
#dartlang
"Dart's familiar language, and cohesive set of
libraries, allowed the team to start building very
quickly."
- Montage
#dartlang
"Dart offers a sane and consistent development experience for modern web
applications."
- Blossom
#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
#dartlang
#dartlang
Export Flash movies/games
to Dart from Flash Pro
#dartlang
"We rewrote Google's internal CRM app in 6
months, from scratch, with Dart and Angular."
- Internal team at Google
#dartlang
TC52 to standardize Dart language
#dartlang
Ready to get started? Write a Dart app!
dartlang.org/codelabs/darrrt/
#dartlang
Dart - for the modern web
● Platform you can use today
● Easy to get started - dartlang.org
● Compiles to JavaScript
#dartlang
Thanks!
j832.com

Más contenido relacionado

Similar a Learn How Dart Can Help Build Modern Web Apps

What’s new in Google Dart - Seth Ladd
What’s new in Google Dart - Seth LaddWhat’s new in Google Dart - Seth Ladd
What’s new in Google Dart - Seth Laddjaxconf
 
Dart : one language to rule them all - MixIT 2013
Dart : one language to rule them all - MixIT 2013Dart : one language to rule them all - MixIT 2013
Dart : one language to rule them all - MixIT 2013Sébastien Deleuze
 
GDG DART Event at Karachi
GDG DART Event at KarachiGDG DART Event at Karachi
GDG DART Event at KarachiImam Raza
 
AngularDart Introduction
AngularDart IntroductionAngularDart Introduction
AngularDart IntroductionNikolaus Graf
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup PerformanceJustin Cataldo
 
Dart, Darrt, Darrrt
Dart, Darrt, DarrrtDart, Darrt, Darrrt
Dart, Darrt, DarrrtJana Moudrá
 
SharePoint Cincy 2012 - jQuery essentials
SharePoint Cincy 2012 - jQuery essentialsSharePoint Cincy 2012 - jQuery essentials
SharePoint Cincy 2012 - jQuery essentialsMark Rackley
 
Structured web programming
Structured web programmingStructured web programming
Structured web programmingahfast
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e bigAndy Peterson
 
JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4alexsaves
 
Django - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazosDjango - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazosIgor Sobreira
 
SharePoint Saturday St. Louis - SharePoint & jQuery
SharePoint Saturday St. Louis - SharePoint & jQuerySharePoint Saturday St. Louis - SharePoint & jQuery
SharePoint Saturday St. Louis - SharePoint & jQueryMark Rackley
 
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..Mark Rackley
 
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...Horacio Gonzalez
 

Similar a Learn How Dart Can Help Build Modern Web Apps (20)

What’s new in Google Dart - Seth Ladd
What’s new in Google Dart - Seth LaddWhat’s new in Google Dart - Seth Ladd
What’s new in Google Dart - Seth Ladd
 
Dart : one language to rule them all - MixIT 2013
Dart : one language to rule them all - MixIT 2013Dart : one language to rule them all - MixIT 2013
Dart : one language to rule them all - MixIT 2013
 
GDG DART Event at Karachi
GDG DART Event at KarachiGDG DART Event at Karachi
GDG DART Event at Karachi
 
Dart - en ny platform til webudvikling af Rico Wind, Google
Dart - en ny platform til webudvikling af Rico Wind, GoogleDart - en ny platform til webudvikling af Rico Wind, Google
Dart - en ny platform til webudvikling af Rico Wind, Google
 
AngularDart Introduction
AngularDart IntroductionAngularDart Introduction
AngularDart Introduction
 
Dartprogramming
DartprogrammingDartprogramming
Dartprogramming
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
 
Dart Workshop
Dart WorkshopDart Workshop
Dart Workshop
 
Dart, Darrt, Darrrt
Dart, Darrt, DarrrtDart, Darrt, Darrrt
Dart, Darrt, Darrrt
 
SharePoint Cincy 2012 - jQuery essentials
SharePoint Cincy 2012 - jQuery essentialsSharePoint Cincy 2012 - jQuery essentials
SharePoint Cincy 2012 - jQuery essentials
 
Structured web programming
Structured web programmingStructured web programming
Structured web programming
 
Introduction to Dart
Introduction to DartIntroduction to Dart
Introduction to Dart
 
Javascript unit testing, yes we can e big
Javascript unit testing, yes we can   e bigJavascript unit testing, yes we can   e big
Javascript unit testing, yes we can e big
 
JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4
 
Django - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazosDjango - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazos
 
Spsemea j query
Spsemea   j querySpsemea   j query
Spsemea j query
 
SharePoint Saturday St. Louis - SharePoint & jQuery
SharePoint Saturday St. Louis - SharePoint & jQuerySharePoint Saturday St. Louis - SharePoint & jQuery
SharePoint Saturday St. Louis - SharePoint & jQuery
 
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
#SPSEMEA SharePoint & jQuery - What I wish I would have known a year ago..
 
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
 
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...
ENIB 2015-2016 - CAI Web - S01E01- Côté navigateur 3/3 - Web components avec ...
 

Último

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Último (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

Learn How Dart Can Help Build Modern Web Apps