TypeScript

Trends

  • New web standards are emerging 

  • ECMAScript continues to evolve on a yearly basis

  • New libraries are trying to define the next set of standards

  • The average website is now the size of Doom 1 (2.39MB)

  • Yet... we're still supporting legacy versions of IE

Transpilers - The Good

  • New language features/concepts

  • Abstracts the changes to the core language

  • Syntatic sugar => Concise code => Reduced Complexity

Transpilers - The Bad

  • Learning curve

  • More complex workflow

The Solution: Transpilers

  • New language features/concepts

  • Syntatic sugar => Concise code => Reduced Complexity

  • Learning curve

  • More complex workflow

Pros

Cons

Our Choice: TypeScript

  • ES6+

  • Full-featured type system

  • Easier to work with Angular2

ES6 Basics

http://es6-features.org/

Some fun things:

  • Arrow functions
  • Destructuring
  • Generators
  • Modules
  • Paramenter handling
  • Proxying / Reflection
  • Scoping
  • String templates

Type Systems

  • Gives you another layer of protection in your code ("Free Tests")
  • Enforces common domain model
  • Boilerplate

  • Leaky abstractions => more confusion

Pros

Cons

Patterns

boolean, number, string, array or Array<T>, tuples, enum

deck

By jimee02

deck

  • 838