de la JVM != Dette technologique = Les fonctions sont «first class citizens» = API asynchrone != Dart est fourni «battery-included» Modèle de thread Gestion de la concurence
'dart:math'; ! class Point { num x, y; ! Point(this.x, this.y); ! num distanceTo(Point other) { var dx = x - other.x; var dy = y - other.y; return sqrt(dx * dx + dy * dy); } } ! main() { var a = new Point(2, 3); var b = new Point(3, 4); print('distance from a to b = ${a.distanceTo(b)}'); }
var message = query('#msg'); ! var b = new ButtonElement() ..classes.add('important') ..text = 'Bro Code' ..onClick.listen((e) => message.text = '''A bro does not dare/challenge another bro to do anything they wouldn’t try them self'''); ! document.body.children.add(b); ! }
8080).then((server) { server.listen((HttpRequest request) { request.response ..write('A bro cannot give another bro a Teddy bear') ..close(); }); print('web server started !'); }); }