Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
How I Learned To Stop Worrying And Love TypeScript
Search
Tommy O'Keefe
November 15, 2019
Programming
1
61
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
Share
More Decks by Tommy O'Keefe
See All by Tommy O'Keefe
Content Challenges: Moving from Amazon Alexa to Google Assistant (and back again :)
tommyokeefe
0
65
Other Decks in Programming
See All in Programming
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
1k
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
Jakarta EE meets AI
ivargrimstad
0
240
みんなでプロポーザルを書いてみた
yuriko1211
0
280
Realtime API 入門
riofujimon
0
150
flutterkaigi_2024.pdf
kyoheig3
0
150
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
340
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
250
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
130
Featured
See All Featured
How to train your dragon (web standard)
notwaldorf
88
5.7k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Music & Morning Musume
bryan
46
6.2k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
900
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Transcript
How I Learned to Stop Worrying and Love TypeScript Tommy
O’Keefe (@tommyokeefe) | RVA JS | November 15, 2019
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?
Why TypeScript?
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
Why Typescript?
Why Me?
“Most Qualified”
“Most Experienced”
“Most Knowledgeable”
None
None
“ What made you a skeptic?
My Background
My Experience
My Own Biases
“ What made you a fan?
Confusion → Clarity
While Reading Code Confusion → Clarity
While Reading Code While Writing Code Confusion → Clarity
While Reading Code While Writing Code While Running Code Confusion
→ Clarity
From Skeptic to Fanboy A Journey in Two Parts
Adding TypeScript to an Existing Project 1. Angular Upgrade
Things That Got Me Like:
Increased Readability & Self Documenting Code
“ Hold up Tommy, can’t TypeScript files be like 30%
longer than a JavaScript file?
Better IDE Support & Integration
“ Wait just a minute Tommy, my IDE already does
all kinds of great stuff, why should I add TypeScript?
Simple, but so Helpful
Key Takeaways
Keep Things Loose At First Keep your config file as
permissive as possible: settings like AllowJS are key!
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
Tighten Things Up Progressively add more meaningful type definitions as
you work through your files.
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.
Using TypeScript for a New Project 2. Alexa, Do You
Like TypeScript?
Things That Got Me Like:
Catching Type Errors at Compilation or Earlier
“ Tommy… Why can’t we just perform these checks at
runtime?
Errors Are Friends, Not Enemies
Errors Are Friends, Not Enemies
Errors Are Friends, Not Enemies
Key Takeaways
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.
Type Any is not Your Friend Get rid of it
wherever you can.
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!
Use Existing Tools Starting a React app? Angular? Vue? Someone
else has undoubtedly already put together a great starter repo you can use!
Helpful Resources Quick Start Samples Migrating JS to TS TypeScript
Handbook (very useful) TypeScript Deep Dive (Basarat Ali Sayed)
None
Thank you!
[email protected]
@tommyokeefe https://npr.codes https://n.pr/tech-jobs https://bit.ly/typescriptfanboy