TypeScript
Curse or Cure
Rafał Warzycha
@rwarzycha
- fullstack JS dev,
- speaker,
- podcast co-host,
- conference maniac
Rafał Warzycha
Disclaimer
Turbo Pascal, C#, TypeScript
Thank you!
Rising popularity
Overall magnitude
JavaScript in "real world"
Superset in theory
Superset in practice
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"
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
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
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,395