KEMBAR78
Hate JavaScript? Try TypeScript. | PDF
HATE JAVASCRIPT?
 TRY TYPESCRIPT



    Ben	
  Hoel(ng	
  
    @benhnet	
  
    b.hoel'ng@aspenware.com	
  
    	
  
Ben	
  
Hoel(ng	
  
In	
  truth,	
  he’s	
  just	
  a	
  big	
  kid.	
  He	
  loves	
  designing	
  systems	
  that	
  solve	
  real	
  world	
  problems.	
  There	
  is	
  
nothing	
  more	
  sa(sfying	
  than	
  seeing	
  something	
  you	
  helped	
  develop	
  being	
  used	
  by	
  the	
  end	
  users.	
  
Ben	
  is	
  also	
  involved	
  in	
  the	
  technology	
  community	
  and	
  runs	
  the	
  South	
  Colorado	
  .NET	
  user	
  group.	
  
He	
  also	
  enjoys	
  speaking	
  at	
  tech	
  groups	
  and	
  events	
  around	
  the	
  country.	
  

                                                                                                                                                        Ben	
  Hoel(ng	
  
                                                                                                                                                        @benhnet	
  
                                                                                                                                                        b.hoel(ng@aspenware.com	
  
                                                                                                                                                        	
  
Agenda:
v TypeScript Defined
v What’s wrong with JavaScript
v What’s right with TypeScript
v TypeScript Basics
v TypeScript and ASP.NET (Web Forms
   and MVC)
v TypeScript for Windows 8 Apps
TYPESCRIPT	
  DEFINED	
  
v    A coding language that compiles to
      JavaScript and provides strong typing and
      other modern coding language features
What’s	
  Wrong	
  with	
  	
  
JavaScript	
  
ISSUES	
  WITH	
  JAVASCRIPT	
  
v    Dynamic Typing Leads to Run Time Errors
v    Lack of Maintainability, Scalability
v    Fine for Small Apps
v    Takes Effort to Write and Learn how to
      Write Clean Code
v    Client Side JavaScript Coding is Different
What’s	
  Right	
  with	
  	
  
TypeScript	
  
TYPESCRIPT	
  ROCKS!	
  
v    “Compiles” to JavaScript
v    Provides Intent at Design Time
v    Any Browser, Any Host (Node.js), Any OS
v    Open Source + Tooling Support
v    Static Typed
v    Provides Encapsulation
      v  Interfaces

      v    Classes
      v    Modules
TypeScript	
  Basics	
  
THE	
  BASICS	
  -­‐	
  AMBIENT	
  DECLARES	
  
v    “declare” Keyword
THE	
  BASICS	
  -­‐	
  TYPES	
  DEFINITIONS	
  
v    “:” To Force a Type Definition
THE	
  BASICS	
  –	
  FUNCTION	
  SIGNATURES	
  
THE	
  BASICS	
  –	
  INTERFACES	
  
THE	
  BASICS	
  –	
  CLASSES	
  
THE	
  BASICS	
  –	
  MODULES	
  
TypeScript	
  Basics	
  	
  
Demo	
  
TypeScript	
  and	
  	
  
the	
  Web	
  Demo	
  
TypeScript	
  and	
  	
  
Windows	
  8	
  Demo	
  
TYPESCRIPT	
  WRAP-­‐UP	
  

          JavaScript’s	
                  TypeScript	
  Basics	
             TypeScript	
  for	
  the	
  
         Shortcomings	
                                                         Enterprise	
  

           JavaScript	
  is	
                   TypeScript	
  is	
  a	
            Tooling	
  for	
  
       dynamically	
  typed,	
                    superset	
  of	
               TypeScript	
  is	
  
        which	
  can	
  lead	
  to	
             JavaScript.	
  	
  It	
     provided	
  for	
  ASP.NET	
  
        run-­‐(me	
  errors.	
  	
       provides	
  sta(c	
  typing	
          and	
  Windows	
  8	
  
         Encapsula(ng	
                    to	
  improve	
  tooling	
           applica(ons	
  by	
  
      JavaScript	
  is	
  difficult,	
        and	
  design-­‐(me	
             installing	
  a	
  plug-­‐in	
  
      which	
  makes	
  it	
  hard	
             valida(on.	
  	
  It	
        for	
  Visual	
  Studio.	
  	
  
          to	
  us	
  in	
  large	
       provides	
  the	
  ability	
  
          applica(ons.	
  	
              to	
  encapsulate	
  your	
  
                                                    scripts.	
  	
  


 19
Resources:	
  
v  http://www.typescriptlang.org
v  http://msdn.microsoft.com/en-us/magazine/
    jj983351.aspx
v  http://msdn.microsoft.com/en-us/magazine/
    jj870740.aspx
v  Pluralsight Course
v  http://blogs.msdn.com/b/typescript/
v  http://typescript.codeplex.com/wikipage?
    title=Roadmap&referringTitle=Home
HATE JAVASCRIPT?
 TRY TYPESCRIPT



    Ben	
  Hoel(ng	
  
    @benhnet	
  
    b.hoel'ng@aspenware.com	
  
    	
  

Hate JavaScript? Try TypeScript.

  • 1.
    HATE JAVASCRIPT? TRYTYPESCRIPT Ben  Hoel(ng   @benhnet   b.hoel'ng@aspenware.com    
  • 2.
    Ben   Hoel(ng   In  truth,  he’s  just  a  big  kid.  He  loves  designing  systems  that  solve  real  world  problems.  There  is   nothing  more  sa(sfying  than  seeing  something  you  helped  develop  being  used  by  the  end  users.   Ben  is  also  involved  in  the  technology  community  and  runs  the  South  Colorado  .NET  user  group.   He  also  enjoys  speaking  at  tech  groups  and  events  around  the  country.   Ben  Hoel(ng   @benhnet   b.hoel(ng@aspenware.com    
  • 3.
    Agenda: v TypeScript Defined v What’s wrongwith JavaScript v What’s right with TypeScript v TypeScript Basics v TypeScript and ASP.NET (Web Forms and MVC) v TypeScript for Windows 8 Apps
  • 4.
    TYPESCRIPT  DEFINED   v  A coding language that compiles to JavaScript and provides strong typing and other modern coding language features
  • 5.
    What’s  Wrong  with     JavaScript  
  • 6.
    ISSUES  WITH  JAVASCRIPT   v  Dynamic Typing Leads to Run Time Errors v  Lack of Maintainability, Scalability v  Fine for Small Apps v  Takes Effort to Write and Learn how to Write Clean Code v  Client Side JavaScript Coding is Different
  • 7.
    What’s  Right  with     TypeScript  
  • 8.
    TYPESCRIPT  ROCKS!   v  “Compiles” to JavaScript v  Provides Intent at Design Time v  Any Browser, Any Host (Node.js), Any OS v  Open Source + Tooling Support v  Static Typed v  Provides Encapsulation v  Interfaces v  Classes v  Modules
  • 9.
  • 10.
    THE  BASICS  -­‐  AMBIENT  DECLARES   v  “declare” Keyword
  • 11.
    THE  BASICS  -­‐  TYPES  DEFINITIONS   v  “:” To Force a Type Definition
  • 12.
    THE  BASICS  –  FUNCTION  SIGNATURES  
  • 13.
    THE  BASICS  –  INTERFACES  
  • 14.
    THE  BASICS  –  CLASSES  
  • 15.
    THE  BASICS  –  MODULES  
  • 16.
  • 17.
    TypeScript  and     the  Web  Demo  
  • 18.
    TypeScript  and     Windows  8  Demo  
  • 19.
    TYPESCRIPT  WRAP-­‐UP   JavaScript’s   TypeScript  Basics   TypeScript  for  the   Shortcomings   Enterprise   JavaScript  is   TypeScript  is  a   Tooling  for   dynamically  typed,   superset  of   TypeScript  is   which  can  lead  to   JavaScript.    It   provided  for  ASP.NET   run-­‐(me  errors.     provides  sta(c  typing   and  Windows  8   Encapsula(ng   to  improve  tooling   applica(ons  by   JavaScript  is  difficult,   and  design-­‐(me   installing  a  plug-­‐in   which  makes  it  hard   valida(on.    It   for  Visual  Studio.     to  us  in  large   provides  the  ability   applica(ons.     to  encapsulate  your   scripts.     19
  • 20.
    Resources:   v  http://www.typescriptlang.org v http://msdn.microsoft.com/en-us/magazine/ jj983351.aspx v  http://msdn.microsoft.com/en-us/magazine/ jj870740.aspx v  Pluralsight Course v  http://blogs.msdn.com/b/typescript/ v  http://typescript.codeplex.com/wikipage? title=Roadmap&referringTitle=Home
  • 21.
    HATE JAVASCRIPT? TRYTYPESCRIPT Ben  Hoel(ng   @benhnet   b.hoel'ng@aspenware.com