SlideShare ist ein Scribd-Unternehmen logo
1 von 38
Downloaden Sie, um offline zu lesen
versus




                                Christian Grobmeier
                              http://www.grobmeier.de
                                     @grobmeier
Donnerstag, 26. April 2012
•       Programmiersprache   •   Heavy Metal Band aus
                   von Google               England

           •       Kann JS ersetzen     •   Ersetzt Hawkwind

           •       Läuft in einer VM    •   Läuft mit Whisky

           •       Für „ernsthafte“     •   Zur täglichen
                   Anwendungen              Anwendungen

           •       Jung und rockt       •   Alt und rockt


Donnerstag, 26. April 2012
Band



                       Lemmy                Mikkey Dee
            Bass + Gesang                    Gitarre
                                Wizzo
                               Schlagzeug
Donnerstag, 26. April 2012
Band




                    Dart Editor             Dart SDK

                                  Dartium

Donnerstag, 26. April 2012
Releases


                    Lang Spec v0.08 :-(
                      kaum Libraries :-(


                                               21 Studioalben!
                                           + unzähliges mehr
Donnerstag, 26. April 2012
Highlights




                                     + 17 mehr!

Donnerstag, 26. April 2012
Highlights

                             Dart ist „Mainstream“, hat eine
                             main-Methode und kennt nur ein
                                           null.




Donnerstag, 26. April 2012
Highlights


                        Dart kennt Interfaces und Klassen




Donnerstag, 26. April 2012
Highlights

          class MyReceiver extends Isolate {
          }
                             Einfachvererbung

          interface Hobbit extends A, B{
          }
                               Mehrvererbung

          class Frodo
                  implements Hobbit, Hungry {
          }
Donnerstag, 26. April 2012
Highlights


                             Dart kennt optionale Typen


               dart --enable_type_checks App.dart




Donnerstag, 26. April 2012
Highlights


                              Dynamic
             class Frodo {
               var hungry;
               bool sleepy;
               Ring ring;
             }




Donnerstag, 26. April 2012
Highlights

                     Dart does not need to drink whisky.
                             It has whisky in it‘s veins.




Donnerstag, 26. April 2012
Highlights

          class Frodo {
            Frodo(num age) : super() {
            }
          }

          var frodo = new Frodo(111);


                             Konstruktor



Donnerstag, 26. April 2012
Highlights


                         class Frodo {
                           Frodo.eat(){
                           }
                         }
                         var frodo = new Frodo.eat();


                             Ein „named Constructor“ verhält
                                  sich wie ein überladener
                                    Konstruktor in Java.

Donnerstag, 26. April 2012
Highlights



                class Frodo {
                  var hungry;
                  Frodo.cook(this.hungry);
                }

                new Frodo.cook(true);




Donnerstag, 26. April 2012
Highlights

        class Frodo {
          bool _hungry;
          bool get hungry() => _hungry;
          void set hungry(bool x) {
            _hungry = x;
          }
        }

                         Get/Set kann nicht überschrieben
                             werden und können nicht
                                  überschreiben.
Donnerstag, 26. April 2012
Highlights




               Frodo f = new Frodo();
               f.hungry = true;


                                   Setter werden wie
                             Standardproperties aufgerufen.

                             GET/SET Methoden vermeiden!

Donnerstag, 26. April 2012
class Hobbit {                    Highlights
    factory Hobbit() {
      return new Hobbit._internal();
    }

        Hobbit._internal() {
          print("Construct");!
        }
   }

   main() {
     Hobbit hobbit = new Hobbit();
   }
                 Das Factory Pattern mit Dart
Donnerstag, 26. April 2012
Highlights


                             Dart ist Library-Scoped




Donnerstag, 26. April 2012
Highlights
                                            Privacy
               class Frodo {           Public
                 eat(){ }
                 _sleep() { }
               }



                             Private

Donnerstag, 26. April 2012
Highlights
                                          Privacy
             #library(„Frodo“);
             class Frodo {...
                                      Public

             #library(„Mordor“);
             #import(„Frodo.dart“);
             new Frodo()...

         Private Elemente sind nicht sichtbar

Donnerstag, 26. April 2012
Highlights


                             Dart Isolates




Donnerstag, 26. April 2012
Threads => Isolates

                     • Isolates erlauben „multithreading“
                     • Isolates kommunizieren via Ports
                     • Isolates werden durch „spawn“ing erzeugt


Donnerstag, 26. April 2012
Isolates
     <body>
      <script type="application/dart">
       main() {
         // Do some DART
       }                          Isolate
      </script>
      <script type="application/dart">
       main() { }
      </script>
     </body>

Donnerstag, 26. April 2012
Isolates


                                  Light                Heavy

       •Leben im gleichen Thread                 •Erzeugen einen neuen Thread
       •Nur ein Isolate auf einmal               •Mehrere Isolates auf einmal

                             Dart entscheidet über den Geschmack.
                              Isolates können keine States teilen!
                                Isolates sind immer asynchron!

Donnerstag, 26. April 2012
Isolates

    process() {
      port.receive((var m, SendPort r) {
          print ("Got message: ${m}");
          r.send("close");
          port.close();
      });
    }




Donnerstag, 26. April 2012
Isolates
  main() {
    port.receive((var m, SendPort r) {
      print("Got message: ${m}");
  !   port.close();
    });

  ! SendPort s = spawnFunction(process);
    s.send("start", port.toSendPort());
  }


Donnerstag, 26. April 2012
• Kein Multithreading - einmal Motörhead,
                         immer Motörhead
                 • Mit Motörhead ist man niemals einsam
                 • Ist der eine Thread einmal beendet, gibt es
                         keine neuen Alben mehr



Donnerstag, 26. April 2012
Road Crew

                      •      HTML

                      •      Templates

                      •      JSON

                      •      Dartdoc

                      •      Frog

                      •      etc.
                                           •   We are the Road Crew

                                           •   Unbekannte Personen

Donnerstag, 26. April 2012
HTML Library

          document.query('#myid');
          document.query('.foo');
          document.queryAll('.foo');


                              Inspiriert von jQuery



Donnerstag, 26. April 2012
HTML Library

          elem.attributes.contains('name');
          elem.attributes['name'];
          elem.attributes['name'] = 'value';
          elem.attributes.remove('name');

                                Collections!



Donnerstag, 26. April 2012
HTML Library
          new Element.tag('div');

          TableElement t = new Element.html(
          '<table><tr><td>Hi</td></tr></table>'
          );

                             Verbesserte Elementerstellung - mit
                                       Konstruktoren

Donnerstag, 26. April 2012
HTML Library

          elem.on.click.add(
              (event) => print('click!'));

          elem.on.click.remove(listener);



                 Alle Events sind in einem Property erreichbar.


Donnerstag, 26. April 2012
Templates
                                                App.dart




                      Hello.tmpl   Hello.dart




                                                App.html




Donnerstag, 26. April 2012
Templates

               template Hello(String to) {
                 <div>${to}</div>
               }



               $ template Hello


Donnerstag, 26. April 2012
Templates

      main() {
        Hello h = new Hello("Motörhead");
        var panel = document.query("#p");
        panel.elements.add(h.root);
      }




Donnerstag, 26. April 2012
And the winner is...




                           en
                         ed
                                  Offenheit
                                 Stabile API
                      hi
                   sc
                               Template System
                nt

                                  Releases
 ne


                                  Zukunft
                             Browserübergreifend
U




                               Android Support
                               Geschwindigkeit
                                 Lautstärke
Donnerstag, 26. April 2012
Röck ön!
                              Danke!

                               Christian Grobmeier
                             http://www.grobmeier.de
                                    @grobmeier



Donnerstag, 26. April 2012

Weitere ähnliche Inhalte

Empfohlen

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 

Empfohlen (20)

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 

Dart @ JUG Saxony

  • 1. versus Christian Grobmeier http://www.grobmeier.de @grobmeier Donnerstag, 26. April 2012
  • 2. Programmiersprache • Heavy Metal Band aus von Google England • Kann JS ersetzen • Ersetzt Hawkwind • Läuft in einer VM • Läuft mit Whisky • Für „ernsthafte“ • Zur täglichen Anwendungen Anwendungen • Jung und rockt • Alt und rockt Donnerstag, 26. April 2012
  • 3. Band Lemmy Mikkey Dee Bass + Gesang Gitarre Wizzo Schlagzeug Donnerstag, 26. April 2012
  • 4. Band Dart Editor Dart SDK Dartium Donnerstag, 26. April 2012
  • 5. Releases Lang Spec v0.08 :-( kaum Libraries :-( 21 Studioalben! + unzähliges mehr Donnerstag, 26. April 2012
  • 6. Highlights + 17 mehr! Donnerstag, 26. April 2012
  • 7. Highlights Dart ist „Mainstream“, hat eine main-Methode und kennt nur ein null. Donnerstag, 26. April 2012
  • 8. Highlights Dart kennt Interfaces und Klassen Donnerstag, 26. April 2012
  • 9. Highlights class MyReceiver extends Isolate { } Einfachvererbung interface Hobbit extends A, B{ } Mehrvererbung class Frodo implements Hobbit, Hungry { } Donnerstag, 26. April 2012
  • 10. Highlights Dart kennt optionale Typen dart --enable_type_checks App.dart Donnerstag, 26. April 2012
  • 11. Highlights Dynamic class Frodo { var hungry; bool sleepy; Ring ring; } Donnerstag, 26. April 2012
  • 12. Highlights Dart does not need to drink whisky. It has whisky in it‘s veins. Donnerstag, 26. April 2012
  • 13. Highlights class Frodo { Frodo(num age) : super() { } } var frodo = new Frodo(111); Konstruktor Donnerstag, 26. April 2012
  • 14. Highlights class Frodo { Frodo.eat(){ } } var frodo = new Frodo.eat(); Ein „named Constructor“ verhält sich wie ein überladener Konstruktor in Java. Donnerstag, 26. April 2012
  • 15. Highlights class Frodo { var hungry; Frodo.cook(this.hungry); } new Frodo.cook(true); Donnerstag, 26. April 2012
  • 16. Highlights class Frodo { bool _hungry; bool get hungry() => _hungry; void set hungry(bool x) { _hungry = x; } } Get/Set kann nicht überschrieben werden und können nicht überschreiben. Donnerstag, 26. April 2012
  • 17. Highlights Frodo f = new Frodo(); f.hungry = true; Setter werden wie Standardproperties aufgerufen. GET/SET Methoden vermeiden! Donnerstag, 26. April 2012
  • 18. class Hobbit { Highlights factory Hobbit() { return new Hobbit._internal(); } Hobbit._internal() { print("Construct");! } } main() { Hobbit hobbit = new Hobbit(); } Das Factory Pattern mit Dart Donnerstag, 26. April 2012
  • 19. Highlights Dart ist Library-Scoped Donnerstag, 26. April 2012
  • 20. Highlights Privacy class Frodo { Public eat(){ } _sleep() { } } Private Donnerstag, 26. April 2012
  • 21. Highlights Privacy #library(„Frodo“); class Frodo {... Public #library(„Mordor“); #import(„Frodo.dart“); new Frodo()... Private Elemente sind nicht sichtbar Donnerstag, 26. April 2012
  • 22. Highlights Dart Isolates Donnerstag, 26. April 2012
  • 23. Threads => Isolates • Isolates erlauben „multithreading“ • Isolates kommunizieren via Ports • Isolates werden durch „spawn“ing erzeugt Donnerstag, 26. April 2012
  • 24. Isolates <body> <script type="application/dart"> main() { // Do some DART } Isolate </script> <script type="application/dart"> main() { } </script> </body> Donnerstag, 26. April 2012
  • 25. Isolates Light Heavy •Leben im gleichen Thread •Erzeugen einen neuen Thread •Nur ein Isolate auf einmal •Mehrere Isolates auf einmal Dart entscheidet über den Geschmack. Isolates können keine States teilen! Isolates sind immer asynchron! Donnerstag, 26. April 2012
  • 26. Isolates process() { port.receive((var m, SendPort r) { print ("Got message: ${m}"); r.send("close"); port.close(); }); } Donnerstag, 26. April 2012
  • 27. Isolates main() { port.receive((var m, SendPort r) { print("Got message: ${m}"); ! port.close(); }); ! SendPort s = spawnFunction(process); s.send("start", port.toSendPort()); } Donnerstag, 26. April 2012
  • 28. • Kein Multithreading - einmal Motörhead, immer Motörhead • Mit Motörhead ist man niemals einsam • Ist der eine Thread einmal beendet, gibt es keine neuen Alben mehr Donnerstag, 26. April 2012
  • 29. Road Crew • HTML • Templates • JSON • Dartdoc • Frog • etc. • We are the Road Crew • Unbekannte Personen Donnerstag, 26. April 2012
  • 30. HTML Library document.query('#myid'); document.query('.foo'); document.queryAll('.foo'); Inspiriert von jQuery Donnerstag, 26. April 2012
  • 31. HTML Library elem.attributes.contains('name'); elem.attributes['name']; elem.attributes['name'] = 'value'; elem.attributes.remove('name'); Collections! Donnerstag, 26. April 2012
  • 32. HTML Library new Element.tag('div'); TableElement t = new Element.html( '<table><tr><td>Hi</td></tr></table>' ); Verbesserte Elementerstellung - mit Konstruktoren Donnerstag, 26. April 2012
  • 33. HTML Library elem.on.click.add( (event) => print('click!')); elem.on.click.remove(listener); Alle Events sind in einem Property erreichbar. Donnerstag, 26. April 2012
  • 34. Templates App.dart Hello.tmpl Hello.dart App.html Donnerstag, 26. April 2012
  • 35. Templates template Hello(String to) { <div>${to}</div> } $ template Hello Donnerstag, 26. April 2012
  • 36. Templates main() { Hello h = new Hello("Motörhead"); var panel = document.query("#p"); panel.elements.add(h.root); } Donnerstag, 26. April 2012
  • 37. And the winner is... en ed Offenheit Stabile API hi sc Template System nt Releases ne Zukunft Browserübergreifend U Android Support Geschwindigkeit Lautstärke Donnerstag, 26. April 2012
  • 38. Röck ön! Danke! Christian Grobmeier http://www.grobmeier.de @grobmeier Donnerstag, 26. April 2012