TypeScript = JavaScript (almost)done rightMaurice de Beijer
Who am I Maurice de Beijer The Problem Solver Microsoft MVP since 2005 DevelopMentor instructor Twitter:   @mauricedb...
Agenda What is TypeScript? Why do we need TypeScript? What is wrong with JavaScript? TypeScript features     Type ann...
What is TypeScript? An open source programming language developed at Microsoft     By Anders Hejlsberg, lead architect o...
Why do we need TypeScript? JavaScript was designed for small scripts These days JavaScript applications get bigger and m...
What is wrong with JavaScript?
Douglas Crockford on TypeScript  Microsofts TypeScript may be the best of the many JavaScript front ends. It seems to    g...
Things TypeScript adds to JavaScript Type annotations Type inference Modules Classes Interfaces Based on the ECMAScr...
Type annotations
Type inference
Type annotations/arrays
Type annotations/param arrays
Arrow functions
Type annotations/casts
TypeScript type definitions The DOM and standard JavaScript types are provided
DefinitelyTyped
Modules
Interfaces
Interfaces
Interfaces & function overloading
Interfaces & type definitions
Classes
Classes & constructors
Classes & constructors
Classes & properties
Arrow functions revisited
Arrow functions revisited
Classes & inheritance
TypeScript is still JavaScript Not all JavaScript problems are solved by TypeScript     Some older browsers support ECMA...
Conclusion TypeScript is not perfect     But it helps a lot You are not forced to use a new language     Leverage exis...
Upcoming SlideShare
Loading in …5
×

Type script = javascript (alomst) done right

2,081 views

Published on

Typescript presentation from the Belgian Visual Studio User Group.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,081
On SlideShare
0
From Embeds
0
Number of Embeds
108
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Type script = javascript (alomst) done right

  1. 1. TypeScript = JavaScript (almost)done rightMaurice de Beijer
  2. 2. Who am I Maurice de Beijer The Problem Solver Microsoft MVP since 2005 DevelopMentor instructor Twitter: @mauricedb Blog: http://msmvps.com/blogs/theproblemsolver/ Web: http://www.HTML5Support.nl E-mail: Maurice.de.Beijer@gmail.com
  3. 3. Agenda What is TypeScript? Why do we need TypeScript? What is wrong with JavaScript? TypeScript features  Type annotations  Type inference  Modules  Classes
  4. 4. What is TypeScript? An open source programming language developed at Microsoft  By Anders Hejlsberg, lead architect of C# A super set of JavaScript  All JavaScript is valid TypeScript  Adds optional type checking, classes, interfaces and more Compiles to “normal” JavaScript  Either ECMAScript 5 or ECMAScipt 3
  5. 5. Why do we need TypeScript? JavaScript was designed for small scripts These days JavaScript applications get bigger and more complex  Gmail is reported to have 443,000 lines of JavaScript in 2010 This trend will continue  Single Page Applications in the browser  Node.js on the server
  6. 6. What is wrong with JavaScript?
  7. 7. Douglas Crockford on TypeScript Microsofts TypeScript may be the best of the many JavaScript front ends. It seems to generate the most attractive code. And I think it should take pressure off of the ECMAScript Standard for new features like type declarations and classes. Anders hasshown that these can be provided nicely by a preprocessor, so there is no need to change the underlying language.I think that JavaScripts loose typing is one of its best features and that type checking isway overrated. TypeScript adds sweetness, but at a price. It is not a price I am willing to pay.
  8. 8. Things TypeScript adds to JavaScript Type annotations Type inference Modules Classes Interfaces Based on the ECMAScript 6 proposed standard
  9. 9. Type annotations
  10. 10. Type inference
  11. 11. Type annotations/arrays
  12. 12. Type annotations/param arrays
  13. 13. Arrow functions
  14. 14. Type annotations/casts
  15. 15. TypeScript type definitions The DOM and standard JavaScript types are provided
  16. 16. DefinitelyTyped
  17. 17. Modules
  18. 18. Interfaces
  19. 19. Interfaces
  20. 20. Interfaces & function overloading
  21. 21. Interfaces & type definitions
  22. 22. Classes
  23. 23. Classes & constructors
  24. 24. Classes & constructors
  25. 25. Classes & properties
  26. 26. Arrow functions revisited
  27. 27. Arrow functions revisited
  28. 28. Classes & inheritance
  29. 29. TypeScript is still JavaScript Not all JavaScript problems are solved by TypeScript  Some older browsers support ECMAScript 3 (December 1999) Some older browsers have non standard DOM/CSS implementations  jQuery remains an extremely useful library
  30. 30. Conclusion TypeScript is not perfect  But it helps a lot You are not forced to use a new language  Leverage existing JavaScript skills en libraries Consider it for your next “large“ JavaScript project  After all the risk is small

×