TypeScript
Curse or Cure
Rafał Warzycha
@rwarzycha
![](https://a248.e.akamai.net/secure.meetupstatic.com/photos/event/2/8/0/2/global_295210242.jpeg)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/142107/images/2932272/just4fun.png)
- fullstack JS dev,
- speaker,
- podcast co-host,
- conference maniac
Rafał Warzycha
![](https://a248.e.akamai.net/secure.meetupstatic.com/photos/event/c/c/7/3/highres_432892339.jpeg)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/142107/images/2003395/IMG_20140925_145207.jpg)
Disclaimer
Turbo Pascal, C#, TypeScript
![](https://sec.ch9.ms/ch9/0521/3768876e-6c34-4d90-b681-8d68ac6d0521/AndersCodeDemo_Custom.jpg)
Thank you!
Rising popularity
Overall magnitude
JavaScript in "real world"
![](http://cdn.wccftech.com/wp-content/uploads/2015/07/welcome_to_the_internet__please_follow_me_by_sharpwriter-d5buwfu.jpg)
Superset in theory
![](https://daveceddia.com/images/venn_typescript_es6_es5.png)
Superset in practice
![](https://c5.staticflickr.com/6/5093/29423877964_ee7fac938b_b.jpg)
TypeScript as a cure ...
TypeScript vs JavaScript
JS problems
- class vs prototypical inheritance
- object - oriented vs functional programming
- conversion - casting vs coercion
- variables - block scope vs function scope
- functions as variable - "first category citizen"
![](https://upload.wikimedia.org/wikipedia/commons/6/6a/JavaScript-logo.png)
Main features
- added compilation - types checks, ...
- some of ES-next features - async/await
- classes and interfaces,
- editors autocomplete - really missed that,
- strict rules via tslint - even on convention or editor level
![](https://raw.githubusercontent.com/remojansen/logo.ts/master/ts.png)
DEMO
Lessons learned
Good
- API is clear and readable
- compilation time is ok,
- features variety is stunning,
- tslint is really powerful and useful,
Bad
- JS is the vast ecosystem - not everybody is considering TS,
- test, debug, build and package management is still nightmare - against all community effort,
- code autocomplete comes with the price
TS is NOT a golden hammer
- logical mistakes,
- async runtime error,
- you need to still understand JS, sorry :(
- additional complexity
- expensive to debug and automate,
- 3rd party libs
It's
Your responsibility
![](http://nelm.io/images/shop/wear/jsmofo/douglas-big.jpg)
Thank you
Q&A
https://github.com/senssei/curse-or-cure
Additional materials
- http://slides.com/ducin/javascript-plus-java-equals-typescript
- https://just4fun.io/odcinek-01-typescript/
TypeScript - Curse or cure
By Rafał Warzycha
TypeScript - Curse or cure
- 1,339