Type-driven development with TypeScript

Lars Lønne

Short workshop - in English

Learn how to use the TypeScript compiler as a tool for writing correct, bug-free code.

Many of us have switched from JavaScript to TypeScript as our language for daily project work. TypeScript improves JavaScript by adding types and a compiler, which by itself can significantly reduce the amount of bugs in your code. But we can do better: by using the type system actively, the compiler goes from being a simple type checker to a mighty coding assistant.

In this workshop, we will explore the possibilities of the TypeScript type system, and how we can actively use it to write correct, bug-free code. We will use interfaces and union types to precisely define our objects, making impossible states impossible. These techniques will save us from writing a lot of tests, and will enable the compiler to guide us towards the correct solution. We will also explore how to configure the TypeScript compiler to catch as many bugs as possible at compile-time.

After this workshop you will no longer think of the compiler as a stumbling block, but rather as a tool that helps you produce high quality code.

Primarily for: Developers

Participant requirements: A computer, with git, node, npm and typescript installed.