Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How I Learned To Stop Worrying And Love TypeScript

How I Learned To Stop Worrying And Love TypeScript

The story of my journey from TypeScript skeptic to TypeScript fanboy

Tommy O'Keefe

November 15, 2019
Tweet

More Decks by Tommy O'Keefe

Other Decks in Programming

Transcript

  1. How I Learned to Stop Worrying and Love TypeScript Tommy

    O’Keefe (@tommyokeefe) | RVA JS | November 15, 2019
  2. Senior full-stack developer At NPR since November 2016 Part of

    the Voice Platforms team since it was formed in September of 2017 Who am I?
  3. Why Typescript? 46.6% - Have used would use again 5.4%

    - Have used wouldn’t use again 33.7% - Heard of it, want to learn 13.7% - Heard of it, not interested
  4. “ Wait just a minute Tommy, my IDE already does

    all kinds of great stuff, why should I add TypeScript?
  5. Keep Things Loose At First Keep your config file as

    permissive as possible: settings like AllowJS are key!
  6. Keep Things Loose At First Keep your config file as

    permissive as possible: settings like AllowJS are key! Focus on adding type annotations that improve readability and expose problem areas in your app
  7. Tighten Things Up Progressively add more meaningful type definitions as

    you work through your files. Tighten up the config and linting rules once your first pass is finished.
  8. Errors Are Your Friends No matter what kind of error

    you encounter, it’s revealing an inconsistency in your code. It’s an ally, not an enemy.
  9. Don’t Forget Your Config! Many quick start guides jump right

    into running tsc from the command line. No matter how small your project is, you need a config!
  10. Use Existing Tools Starting a React app? Angular? Vue? Someone

    else has undoubtedly already put together a great starter repo you can use!
  11. Helpful Resources Quick Start Samples Migrating JS to TS TypeScript

    Handbook (very useful) TypeScript Deep Dive (Basarat Ali Sayed)