SlideShare una empresa de Scribd logo
1 de 48
Descargar para leer sin conexión
How I Learned to Stop
Worrying and Love
TypeScript
Tommy O’Keefe (@tommyokeefe) | NationJS Frontrunners | May 10, 2019
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”
How I Learned to Stop Worrying and Love Typescript
How I Learned to Stop Worrying and Love Typescript
“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)
How I Learned to Stop Worrying and Love Typescript
Thank you!
tokeefe@npr.org
@tommyokeefe
https://npr.codes
https://n.pr/tech-jobs

Más contenido relacionado

Similar a How I Learned to Stop Worrying and Love Typescript

Markdown - friend or foe?
Markdown - friend or foe?Markdown - friend or foe?
Markdown - friend or foe?Ellis Pratt
 
Recipes to Get Started in Open Source
Recipes to Get Started in Open SourceRecipes to Get Started in Open Source
Recipes to Get Started in Open SourceSuneet Srivastava
 
Cinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patternsCinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patternsSteven Smith
 
Why Is Assessment Feedback Important?: Innovative Ways to Grade
Why Is Assessment Feedback Important?: Innovative Ways to GradeWhy Is Assessment Feedback Important?: Innovative Ways to Grade
Why Is Assessment Feedback Important?: Innovative Ways to Gradecoachfeliciab
 
Design for developers (april 25, 2017)
Design for developers (april 25, 2017)Design for developers (april 25, 2017)
Design for developers (april 25, 2017)Thinkful
 
Microsoft Word Reference Manager for Researchers Part I
Microsoft Word Reference Manager for Researchers Part IMicrosoft Word Reference Manager for Researchers Part I
Microsoft Word Reference Manager for Researchers Part IOmisile Kehinde Olugbenga
 
How To Become A Good C# Programmer
How To Become A Good C# ProgrammerHow To Become A Good C# Programmer
How To Become A Good C# ProgrammerLearnItFirst.com
 
Static Type Checking with FlowJs
Static Type Checking with FlowJsStatic Type Checking with FlowJs
Static Type Checking with FlowJsUnfold UI
 
How to Drive 500 000 App Installs? FareFirst case
How to Drive 500 000 App Installs? FareFirst caseHow to Drive 500 000 App Installs? FareFirst case
How to Drive 500 000 App Installs? FareFirst caseTravelpayouts
 
Kickass Agile Development - Agile & Beyond Conference
Kickass Agile Development - Agile & Beyond ConferenceKickass Agile Development - Agile & Beyond Conference
Kickass Agile Development - Agile & Beyond ConferenceDan Chuparkoff
 
Developers Best Practices
Developers Best PracticesDevelopers Best Practices
Developers Best Practicesaqib javaid
 
Open source and then some: An Introduction
Open source and then some: An IntroductionOpen source and then some: An Introduction
Open source and then some: An IntroductionAkash Tandon
 
How to unlock the secrets of effortless keyword research with ChatGPT.pptx
How to unlock the secrets of effortless keyword research with ChatGPT.pptxHow to unlock the secrets of effortless keyword research with ChatGPT.pptx
How to unlock the secrets of effortless keyword research with ChatGPT.pptxDaniel Smullen
 
JAZOON'13 - Sven Peters - How to do Kick-Ass Software Development
JAZOON'13 - Sven Peters - How to do Kick-Ass Software DevelopmentJAZOON'13 - Sven Peters - How to do Kick-Ass Software Development
JAZOON'13 - Sven Peters - How to do Kick-Ass Software Developmentjazoon13
 
Writing-Best-Practices
Writing-Best-PracticesWriting-Best-Practices
Writing-Best-PracticesCandace Loya
 

Similar a How I Learned to Stop Worrying and Love Typescript (20)

Markdown - friend or foe?
Markdown - friend or foe?Markdown - friend or foe?
Markdown - friend or foe?
 
Recipes to Get Started in Open Source
Recipes to Get Started in Open SourceRecipes to Get Started in Open Source
Recipes to Get Started in Open Source
 
Cinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patternsCinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patterns
 
Why Is Assessment Feedback Important?: Innovative Ways to Grade
Why Is Assessment Feedback Important?: Innovative Ways to GradeWhy Is Assessment Feedback Important?: Innovative Ways to Grade
Why Is Assessment Feedback Important?: Innovative Ways to Grade
 
Design for developers (april 25, 2017)
Design for developers (april 25, 2017)Design for developers (april 25, 2017)
Design for developers (april 25, 2017)
 
Microsoft Word Reference Manager for Researchers Part I
Microsoft Word Reference Manager for Researchers Part IMicrosoft Word Reference Manager for Researchers Part I
Microsoft Word Reference Manager for Researchers Part I
 
How To Become A Good C# Programmer
How To Become A Good C# ProgrammerHow To Become A Good C# Programmer
How To Become A Good C# Programmer
 
Static Type Checking with FlowJs
Static Type Checking with FlowJsStatic Type Checking with FlowJs
Static Type Checking with FlowJs
 
PyTexas 2014
PyTexas   2014PyTexas   2014
PyTexas 2014
 
How to code
How to codeHow to code
How to code
 
Peer review
Peer reviewPeer review
Peer review
 
How to Drive 500 000 App Installs? FareFirst case
How to Drive 500 000 App Installs? FareFirst caseHow to Drive 500 000 App Installs? FareFirst case
How to Drive 500 000 App Installs? FareFirst case
 
Kickass Agile Development - Agile & Beyond Conference
Kickass Agile Development - Agile & Beyond ConferenceKickass Agile Development - Agile & Beyond Conference
Kickass Agile Development - Agile & Beyond Conference
 
Landing Your Next PHP Job
Landing Your Next PHP JobLanding Your Next PHP Job
Landing Your Next PHP Job
 
Developers Best Practices
Developers Best PracticesDevelopers Best Practices
Developers Best Practices
 
Agile Testing
Agile TestingAgile Testing
Agile Testing
 
Open source and then some: An Introduction
Open source and then some: An IntroductionOpen source and then some: An Introduction
Open source and then some: An Introduction
 
How to unlock the secrets of effortless keyword research with ChatGPT.pptx
How to unlock the secrets of effortless keyword research with ChatGPT.pptxHow to unlock the secrets of effortless keyword research with ChatGPT.pptx
How to unlock the secrets of effortless keyword research with ChatGPT.pptx
 
JAZOON'13 - Sven Peters - How to do Kick-Ass Software Development
JAZOON'13 - Sven Peters - How to do Kick-Ass Software DevelopmentJAZOON'13 - Sven Peters - How to do Kick-Ass Software Development
JAZOON'13 - Sven Peters - How to do Kick-Ass Software Development
 
Writing-Best-Practices
Writing-Best-PracticesWriting-Best-Practices
Writing-Best-Practices
 

Último

Why Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfWhy Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfBrain Inventory
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeNeo4j
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesSoftwareMill
 
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsJaydeep Chhasatia
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Incrobinwilliams8624
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIIvo Andreev
 
Fields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxFields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxJoão Esperancinha
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Jaydeep Chhasatia
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadIvo Andreev
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampVICTOR MAESTRE RAMIREZ
 
Webinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptWebinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptkinjal48
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024Mind IT Systems
 
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfTobias Schneck
 
Watermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security ChallengesWatermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security ChallengesShyamsundar Das
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilVICTOR MAESTRE RAMIREZ
 
ERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxAutus Cyber Tech
 
OpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorOpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorShane Coughlan
 
Sales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales CoverageSales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales CoverageDista
 
Kawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies
 

Último (20)

Why Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfWhy Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdf
 
Salesforce AI Associate Certification.pptx
Salesforce AI Associate Certification.pptxSalesforce AI Associate Certification.pptx
Salesforce AI Associate Certification.pptx
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG time
 
Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retries
 
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Inc
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AI
 
Fields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptxFields in Java and Kotlin and what to expect.pptx
Fields in Java and Kotlin and what to expect.pptx
 
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
Optimizing Business Potential: A Guide to Outsourcing Engineering Services in...
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and Bad
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - Datacamp
 
Webinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.pptWebinar_050417_LeClair12345666777889.ppt
Webinar_050417_LeClair12345666777889.ppt
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024
 
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
 
Watermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security ChallengesWatermarking in Source Code: Applications and Security Challenges
Watermarking in Source Code: Applications and Security Challenges
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-Council
 
ERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptx
 
OpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorOpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS Calculator
 
Sales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales CoverageSales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales Coverage
 
Kawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in Trivandrum
 

How I Learned to Stop Worrying and Love Typescript

Notas del editor

  1. Over 20,000 sureyed
  2. Over 20,000 sureyed