Dynamic Vs Static

Post on 11-Nov-2014

762 views 1 download

description

 

Transcript of Dynamic Vs Static

   

Discussion

● Topic: Dynamic vs Static Languages● What is this about?

● What are they?● How are they different?● When to use?

● What is this not about?● Arguing who's right or wrong

   

Let's Not Do This

Don't get tooworked up please!

   

Discussion Kick-Off

● What is a dynamic language?

   

Dynamic Typing (1)

private static void printCapitalOf(Country country){ System.out.println(country.capitalCity());}

public static void main(String[] args){ Country aus = new Australia(); Country jpn = new Japan(); printCapitalOf(aus); printCapitalOf(jpn);}

   

Dynamic Typing (2)

private static void printCapitalOf(Country country){ System.out.println(country.capitalCity());}

public static void main(String[] args){ Country aus = new Australia(); Country jpn = new Japan(); printCapitalOf(aus); printCapitalOf(jpn);}

   

Dynamic Typing (3)

def printCapitalOf(country){ print(country.capitalCity())}

def aus = new Australia();def jpn = new Japan();printCapitalOf(aus);printCapitalOf(jpn);

   

Dynamic Typing (4)

● Only for saving keystrokes?● Is punching keys really hard?

   

Summary

Use the right tool for the job!