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
78
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
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
74
Other Decks in Programming
See All in Programming
JAWS-UG横浜 #102 AWSサ終供養LT会 成仏できない AWS サービスたち 〜本日、三体供養します〜
maroon1st
0
350
テーブルをDELETEした
yuzneri
0
140
<title><a id="</title>君はこのHTMLをパースできるか"></a></title> #雑LT_study
pizzacat83
0
140
「人を評価する AI」の設計と実装
ryoyanara
0
190
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
170
AIが無かった頃の素敵な出会いの話
codmoninc
1
420
5分で問診!Composer セキュリティ健康診断
codmoninc
0
970
the container ship “Apple Silicon”@WWDC26 Recap -Japan-\(region).swift
shingangan
0
120
自動化したのに回らないテスト運用の壁ーAI時代の品質責任と生産性
mfunaki
0
130
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
220
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
220
自動化したのに回らない テスト運用の壁―AI時代の品質責任と生産性
mfunaki
0
160
Featured
See All Featured
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.1k
Odyssey Design
rkendrick25
PRO
2
750
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3k
GitHub's CSS Performance
jonrohan
1033
470k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.2k
My Coaching Mixtape
mlcsv
0
220
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.1k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.3k
RailsConf 2023
tenderlove
30
1.5k
The Language of Interfaces
destraynor
162
27k
Embracing the Ebb and Flow
colly
88
5.1k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
390
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