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
68
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
69
Other Decks in Programming
See All in Programming
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
240
Go Modules: From Basics to Beyond / Go Modulesの基本とその先へ
kuro_kurorrr
0
120
Select API from Kotlin Coroutine
jmatsu
1
180
生成AIで日々のエラー調査を進めたい
yuyaabo
0
620
『自分のデータだけ見せたい!』を叶える──Laravel × Casbin で複雑権限をスッキリ解きほぐす 25 分
akitotsukahara
1
310
Java on Azure で LangGraph!
kohei3110
0
160
Using AI Tools Around Software Development
inouehi
0
1.2k
Create a website using Spatial Web
akkeylab
0
290
「Cursor/Devin全社導入の理想と現実」のその後
saitoryc
0
100
WindowInsetsだってテストしたい
ryunen344
1
190
セキュリティマネジャー廃止とクラウドネイティブ型サンドボックス活用
kazumura
1
190
Effect の双対、Coeffect
yukikurage
5
1.4k
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
181
53k
Side Projects
sachag
455
42k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
The Pragmatic Product Professional
lauravandoore
35
6.7k
RailsConf 2023
tenderlove
30
1.1k
How GitHub (no longer) Works
holman
314
140k
Designing for Performance
lara
609
69k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
228
22k
Git: the NoSQL Database
bkeepers
PRO
430
65k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.5k
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