SlideShare uma empresa Scribd logo
1 de 28
Baixar para ler offline
Typisierung
Typisierung?
• Festlegen des Typs einer Variablen
int i = 42;
Typisierung?
• Festlegen des Typs einer Variablen
• Das System kann überprüfen ob eine
  Verletzung des Typsystems vorliegt
       Vermeidung von Laufzeitfehlern
Typisierung?
• Festlegen des Typs einer Variablen
• Das System kann überprüfen ob keine
  Verletzung des Typsystems vorliegt
       Vermeidung von Laufzeitfehlern
• Das System kann die richtige Menge
  Speicher für die Variable reservieren
       Speicheroptimierung
Wonach unterscheidet man?

     statisch   dynamisch
       stark    schwach
     explizit   implizit
statisch:
      der Compiler prüft       (ob alles korrekt ist)



dynamisch:
    keiner prüft   (Problem: Laufzeitfehler)
String s = "Hallo";
s = s.gehNachHause();
String s = "Hallo";
s = s.gehNachHause();

  statisch typisiert:
         Compiler „meckert“,
         Programm startet nicht
String s = "Hallo";
s = s.gehNachHause();

  dynamisch typisiert:
         Programm startet,
         läuft bis zu dieser Stelle,
         schmiert ab
stark:
     zwischen den Typen wird
     streng unterschieden
schwach:
    das System versucht die Daten
    in den geforderten Typ
    zu konvertieren
i = 42;
   s = "8";
ergebnis = i + s;
i = 42;
   s = "8";
ergebnis = i + s;

      stark typisiert:
             Fehler zur Kompilierungs-
             oder Lauf-Zeit
i = 42;
   s = "8";
ergebnis = i + s;

      schwach typisiert:
             s wird konvertiert,
             ergebnis ist 50.
explizit:
     Datentyp einer Variable MUSS
     genannt werden
implizit:
     Datentyp wird ermittelt
int i = 42;
String s = "8";


   explizit typisiert:
          Datentyp wird genannt.
i = 42;
 s = "8";


implizit typisiert:
       Datentyp wird ermittelt.
Beispiel: Java?

      statisch    dynamisch
         stark    schwach
       explizit   implizit
Beispiel: Java

      statisch   dynamisch
        stark    schwach
      explizit   implizit
Beispiel: C?

      statisch    dynamisch
         stark    schwach
       explizit   implizit
Beispiel: C

      statisch    dynamisch
         stark    schwach
       explizit   implizit
Beispiel: C#?

      statisch   dynamisch
        stark    schwach
      explizit   implizit
Beispiel: C#

      statisch     dynamisch
        stark      schwach
      explizit     implizit
            int i = 2;
            var j = 3;
Beispiel: PHP?

      statisch   dynamisch
        stark    schwach
      explizit   implizit
Beispiel: PHP

      statisch   dynamisch
        stark    schwach
      explizit   implizit
Beispiel: Python?

      statisch   dynamisch
        stark    schwach
      explizit   implizit
Beispiel: Python

      statisch   dynamisch
        stark    schwach
      explizit   implizit
Fragen!

Mais conteúdo relacionado

Destaque

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
Kurio // The Social Media Age(ncy)
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
 

Destaque (20)

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...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

Typisierung

  • 2. Typisierung? • Festlegen des Typs einer Variablen
  • 3. int i = 42;
  • 4. Typisierung? • Festlegen des Typs einer Variablen • Das System kann überprüfen ob eine Verletzung des Typsystems vorliegt Vermeidung von Laufzeitfehlern
  • 5. Typisierung? • Festlegen des Typs einer Variablen • Das System kann überprüfen ob keine Verletzung des Typsystems vorliegt Vermeidung von Laufzeitfehlern • Das System kann die richtige Menge Speicher für die Variable reservieren Speicheroptimierung
  • 6. Wonach unterscheidet man? statisch dynamisch stark schwach explizit implizit
  • 7. statisch: der Compiler prüft (ob alles korrekt ist) dynamisch: keiner prüft (Problem: Laufzeitfehler)
  • 8. String s = "Hallo"; s = s.gehNachHause();
  • 9. String s = "Hallo"; s = s.gehNachHause(); statisch typisiert: Compiler „meckert“, Programm startet nicht
  • 10. String s = "Hallo"; s = s.gehNachHause(); dynamisch typisiert: Programm startet, läuft bis zu dieser Stelle, schmiert ab
  • 11. stark: zwischen den Typen wird streng unterschieden schwach: das System versucht die Daten in den geforderten Typ zu konvertieren
  • 12. i = 42; s = "8"; ergebnis = i + s;
  • 13. i = 42; s = "8"; ergebnis = i + s; stark typisiert: Fehler zur Kompilierungs- oder Lauf-Zeit
  • 14. i = 42; s = "8"; ergebnis = i + s; schwach typisiert: s wird konvertiert, ergebnis ist 50.
  • 15. explizit: Datentyp einer Variable MUSS genannt werden implizit: Datentyp wird ermittelt
  • 16. int i = 42; String s = "8"; explizit typisiert: Datentyp wird genannt.
  • 17. i = 42; s = "8"; implizit typisiert: Datentyp wird ermittelt.
  • 18. Beispiel: Java? statisch dynamisch stark schwach explizit implizit
  • 19. Beispiel: Java statisch dynamisch stark schwach explizit implizit
  • 20. Beispiel: C? statisch dynamisch stark schwach explizit implizit
  • 21. Beispiel: C statisch dynamisch stark schwach explizit implizit
  • 22. Beispiel: C#? statisch dynamisch stark schwach explizit implizit
  • 23. Beispiel: C# statisch dynamisch stark schwach explizit implizit int i = 2; var j = 3;
  • 24. Beispiel: PHP? statisch dynamisch stark schwach explizit implizit
  • 25. Beispiel: PHP statisch dynamisch stark schwach explizit implizit
  • 26. Beispiel: Python? statisch dynamisch stark schwach explizit implizit
  • 27. Beispiel: Python statisch dynamisch stark schwach explizit implizit