TypeScript
good practices & pro techniques
Kamil Durkiewicz
Agenda
- Introduction
- General remarks
- Type algebra
- Classes
- Enums
- Currying
- Function / method overloading
- Generic types
- Summary
- Questions
TypeScript - facts
- 1st release: 2012-10-01
- Currently in version 2.3
- Open source, maintained by Microsoft
- Superset of ES6
- Compiled to JavaScript
- Only a language (without frameworks)
Avoid dynamic typing
- any
- Function
- bind, call, apply
Class is also an interface
Function / method overloading
Don't forget about generics
Summary
- Avoid dynamic typing
- Learn and use syntactic sugars
- Learn types algebra well
- Don't spoil your generics