Home
Categories
EXPLORE
True Crime
Comedy
Business
Society & Culture
Sports
Technology
History
About Us
Contact Us
Copyright
© 2024 PodJoint
00:00 / 00:00
Sign in

or

Don't have an account?
Sign up
Forgot password
https://is1-ssl.mzstatic.com/image/thumb/Podcasts125/v4/f3/de/0e/f3de0ec1-a1ff-ad7e-1d42-2ee41cae7253/mza_7142444209140500111.png/600x600bb.jpg
3 Minutes with Kent
Kent C. Dodds
235 episodes
8 months ago
👋 Hi there! I'm Kent C. Dodds (https://twitter.com/kentcdodds). This is a (week)daily podcast where I give 3 minute thoughts about web development. You can subscribe on iTunes here: http://kcd.im/3-mins-itunes and on RSS here: http://kcd.im/3-mins-rss
Show more...
Technology
RSS
All content for 3 Minutes with Kent is the property of Kent C. Dodds and is served directly from their servers with no modification, redirects, or rehosting. The podcast is not affiliated with or endorsed by Podjoint in any way.
👋 Hi there! I'm Kent C. Dodds (https://twitter.com/kentcdodds). This is a (week)daily podcast where I give 3 minute thoughts about web development. You can subscribe on iTunes here: http://kcd.im/3-mins-itunes and on RSS here: http://kcd.im/3-mins-rss
Show more...
Technology
https://briefs-production.s3.amazonaws.com/cover_art/34/Drawing__1_.png
TypeScript is testing
3 Minutes with Kent
2 minutes 47 seconds
4 years ago
TypeScript is testing
https://kcd.im/trophy https://kentcdodds.com/blog/eliminate-an-entire-category-of-bugs-with-a-few-simple-tools TypeScript is tests. Tests are type script. So type script is just a way to give yourself more confidence. Sure, it helps you in your workflow, it makes you a faster as you're developing because you have autocomplete and stuff like that. And testing does the same thing as well as you refactoring, you know that you didn't break anything you get a much faster feedback when you you're running your tests as you're working on things. And both of these also make the initial code take longer. So it takes more time to think.About the types that you're writing takes more time to actually write the tests. And they can also be an enormous time sink where you spend a ton of time working on a task or a ton of time working on the on the types and then you've later realized that you don't need that code at all so you just throw all that work away. So, I I find that typescript and testing are way more related than they are or similar than they are different. And I think this is a good thing though, the whole goal is to be more confident in the changes that were.Making in the application that were shipping. And the cool thing about TypeScript is that it eliminates an entire category of bugs. I actually have a blog post about that. And it also eliminates an entire category of tests, which you're probably not writing but maybe you should. So one of the things about code coverage is that it doesn't what we really actually need is data coverage or use case coverage because you may have a function called ad that accepts two numbers and add. S them together and you could write a couple of tests for that if you wanted to but you're probably not writing like it's not very normal for people to write a test that says what happens if I pass a string what happens if I pass a boolean but you know, what a you might have a test that says what happens if I don't pass the arguments or something and because there are some defaults. But and that and because there are defaults you're going to want to cover that. But we've very often don't do a whole lot of defensive programming and runtime and type assertions of.You know, what the arguments that were passed? Maybe you do that for some of your functions, but probably not all. And so you can you don't get a much confidence in in that aspect. And you you could but it's just way easier to just use a type to language like TypeScript and then that entire category of bugs in the entire category of tests don't need to be written. So type script is tests.
3 Minutes with Kent
👋 Hi there! I'm Kent C. Dodds (https://twitter.com/kentcdodds). This is a (week)daily podcast where I give 3 minute thoughts about web development. You can subscribe on iTunes here: http://kcd.im/3-mins-itunes and on RSS here: http://kcd.im/3-mins-rss