Skip to content

Instantly share code, notes, and snippets.

@damncabbage
Last active June 4, 2017 13:22
Show Gist options
  • Save damncabbage/5f17b8fd6e9184f86f1b63ccc379c10a to your computer and use it in GitHub Desktop.
Save damncabbage/5f17b8fd6e9184f86f1b63ccc379c10a to your computer and use it in GitHub Desktop.
The DDDSydney submission that bounced.

JS Type-Checking Tools and Techniques

It's easy to make mistakes when writing code. We have some commonly-used tools to help us with this, with tests and linters, but there's more out there. Tools like Flow[1] and TypeScript[2] can be used to have the computer help us check our code, and can act as another protective barrier to bugs and blunders.

We'll explore types and type-checking with Flow. You'll see common bugs it catches and, step-by-step, will learn both how to use it, and how to reduce the number of tests you need to write. We'll then walk through more advanced techniques, using unions, wrappers, gatekeepers, phantoms, and other things besides to build a small robust app.

To enjoy this talk, you'll ideally have an intermediate-level understanding of JavaScript. We'll start easy with types and Flow, but will ramp it up as we go to keep things interesting if you're a more experienced user of either.

(Though this session uses Flow for its examples, but pretty much everything will be directly transferable to TypeScript with little effort.)

  1. http://flow.org/
  2. http://typescriptlang.org/

Pre-Reqs: Intermediate-level JS

Rob Howard is a web developer who currently switches between Haskell, JavaScript and PureScript at Ambiata. He spends his days immersed in functional programming and static type-checking, using them to build web UIs and backend services.

Having so far made a career from learning and mixing the nice parts from different programming languages, he'd like nothing better than to help programming communities to learn more from each other.


http://robhoward.id.au
@damncabbage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment