3 Minutes with Kent artwork

3 Minutes with Kent

235 episodes - English - Latest episode: almost 3 years ago - β˜…β˜…β˜…β˜…β˜… - 4 ratings

πŸ‘‹ 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

Technology Education How To
Homepage Apple Podcasts Google Podcasts Overcast Castro Pocket Casts RSS feed

Episodes

Prisma is amazing

June 10, 2021 15:07 - 2 minutes - 2.89 MB

Hey there friends. So yesterday I was just a fanboying I guess about Prisma. If you haven't heard of Prisma, it is a Oh what does that? It's ORN, I can't remember what what the word for that is but it interfaces between you and a backend database. So it supports post-grass and SQLite my sequel and a MongoDB support is coming. So yeah, just so you have a database and you tell it what database what kind of,Database you're hitting and how to connect to it or what the connection URL is. And then ...

Using ScriptKit to easily upload images to @cloudinary

June 08, 2021 19:03 - 2 minutes - 2.83 MB

https://github.com/johnlindquist/kit/discussions/310 https://www.scriptkit.com/ Hello friends. So this morning, I finished something that I was working on a little bit yesterday. It's a script kit script to call Cloud Nary upload which allows me to very easily upload images to my cloud nary account. It uses the cloud nary API and yeah, I just need a couple of environment variables and and you can use this too. You get script kit, you can copy the same script. And yeah, you just need a couple ...

Avoid Hasty Abstractions: Hooks edition

June 07, 2021 18:19 - 2 minutes - 2.89 MB

Hello friends, so I wanted to talk today about whether or not you should make a custom hook for everything. So a few days ago, maybe last week there was this thing going around where people were recommending that you never ever use the react built-in hooks inside of a component, you always extract it to a custom hook. This is terrible advice. Don't do that at all. So the way that I think about hooks in React is the they're basically functions that have the,Only special distinction of being fu...

performance.mark and performance.measure for improved DevTools profiling

June 04, 2021 20:01 - 2 minutes - 2.84 MB

https://stackoverflow.com/a/46780568/971592 Hello there friends. Sorry, it's been a little bit of a break but I was working on something and I wanted to measure how fast it was but yeah and so I'm gonna use the Chrome DevTools profiling performance tab to profile it. And it's always so frustrating to like try and find the part of the code that you're trying to profile in that flame graph. It's really kind of a confusing area. And I remembered that there's the performance mark API and so you h...

Make your DB schema as restrictive as possible for easier migrations

June 02, 2021 22:30 - 2 minutes - 2.34 MB

Hello there friends. Welcome to June I am thinking about Postgres and Prisma and that sort of thing a lot lately because I'm working on my website and doing that sort of thing and one tip that I have for you if you ever do database sort of things is try to make sorry to make your data as. As restrictive as possible. Early on as as you're trying to make things. So like make things if you're like, I don't know if there should be a required field or not make it required. If you're this is an enu...

Fixating on fixing rerenders

May 29, 2021 22:00 - 2 minutes - 2.86 MB

https://kentcdodds.com/blog/fix-the-slow-render-before-you-fix-the-re-render https://kentcdodds.com/blog/colocation https://epicreact.dev/improve-the-performance-of-your-react-forms Hello there friends. So today somebody shared a lightbri with me and I assumed that it was just a library to help you track rerenders. But it turns out it's like a state management library and that helps you avoid rerenders but my initial reaction and thought about tracking re-renders is the tools like that. I thi...

Keep related utilities in a single file

May 28, 2021 18:13 - 2 minutes - 2.78 MB

Hello there friends, so I was thinking this morning about utilities and you know these little utility functions that we write and we put it in like a utils modular or something and sometimes when we're running these we want to split things out to make it just.Easier to manage or something and and it's just kind of a natural thing at least for me to want to split things out into individual files, so each utility is in its own file, you know, if it's just a single line or something. I typically...

if statements and "We'll cross that bridge when we come to it"

May 27, 2021 14:08 - 2 minutes - 2.86 MB

Good morning or afternoon or evening friends, I wanted to talk today about a saying that my wife has I think when my kids grow up they're gonna remember my mom always used to say this and and so what she says is we'll cross that bridge when we come to it now, of course this isn't like an original saying but she just says it a lot and what she's saying is that she doesn't want to make these decisions right now or use up the mental energy to decide whether or not. She wants to let the kids do a...

Global gitignore and .ignored files/folders

May 26, 2021 17:25 - 2 minutes - 2.84 MB

Hello there friends So this morning I was just thinking about this little tip that I share with you. It's pretty quick. In my global git ignore, which is located in my home directory dot get ignore underscore global. I have a couple of things in here that I wanted to shout out and specifically this morning. I was thinking about my ignored global good ignore. So I am I have a two rules that will ignore any files that or any directories that end in dot ignored in any files that include dot igno...

docker volume prune

May 25, 2021 17:15 - 2 minutes - 2.87 MB

Hello friends so I mostly recording this one so that I can hopefully not forget it because I was working with doctor yesterday and I don't work with Docker a lot but I'm kind of thinking about in the next version of Epic React. I want to take the application that we build and make it even more real world. We're going to jump off of Create. React app and use Remix. Don't worry, they're probably going to have some sort of free tier or a trial version or something. So, I'm not going to force peo...

The nuance of promotion, incentives, ulterior motives, and the benefit of the doubt

May 24, 2021 14:01 - 2 minutes - 2.87 MB

Hello there friends, so I've just been thinking about incentives and companies and and the yeah, like what what motivates people to have different opinions and stuff like that. And I want to use myself as an example here because I think it's a there's a lot of nuance with the way that we kind of automatically think that people are have ulterior motives. So, I created epic react to teach people how to learn react. And so my question is did did I create epic react?And then say hey everybody it'...

Smart watches, smart rings, and Progressive Web Apps

May 21, 2021 14:01 - 2 minutes - 2.87 MB

Hey there friends. Have you heard of progressive enhancement or progressive web apps? Well, I thought of a real world thing that kind of resembles what this actually means and what it doesn't. So, you know how like there's all these memes of like I got a smart thermostat and now it's broken because my internet went down or something like that and so now I'm like steaming hot like why did I do this and and we have the same sort of thing with my watch and so I have a smartwatch. It's a,Nice one...

TypeScript is testing

May 20, 2021 14:59 - 2 minutes - 2.7 MB

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 r...

TypeScript: Why I prefer `Array<Type>` over `Type[]`

May 19, 2021 14:36 - 2 minutes - 2.67 MB

Good morning or afternoon or whatever it is for you friends, it's morning for me. I wanted to talk about how I type a raise in TypeScript, so there are two ways that I'm aware of that you can type an array and of course I guess there are a couple ways depending on what type of an array you want to make but just like a regular array you can either specify the type and then immediately thereafter with no space a open and closing bracket like the the syntax for an array and the alternative is th...

Don't bundle and minify your published npm packages

May 19, 2021 02:51 - 2 minutes - 2.84 MB

https://twitter.com/kentcdodds/status/1394420201542668289?s=20 So the other day I tweeted about how I really want people to stop minifying and bundling what they send to NPM. And just to clarify I it's fine if you want to minify and bundle as one of the things you distribute as part of your package, but it shouldn't be the only thing and there are a couple of reasons and what I do for my packages is I actually do have a UMD module that is bundled and I have a minified version of that as well....

Sharing server/client validation logic with @remix_run

May 17, 2021 21:03 - 2 minutes - 2.83 MB

Hey friends, so I'm working on this little remix app and just something about remix that I just this so cool the fact that your server and client side code run is written in the same file if in case you didn't know that that's that's what you do and it's really cool for validation so you can start by validating just a hundred percent on the server and remix makes it quite nice to be able to do that and that's where your validation should absolutely. 100% go by default that's like if you're go...

Tests the tests by making them fail

May 16, 2021 03:01 - 2 minutes - 2.49 MB

https://kentcdodds.com/blog/make-your-test-fail Hello there friends. I'm just driving now. I was thinking about a blog post that I wrote a while ago. I think it was called break your tests or something like that, but the idea is that it's just really easy to write a test that passes and so you feel really good about it this this especially happens if you're testing after you've already implemented something if you're doing TDD this is maybe less of a problem, but it's really easy to write a t...

Cypress Driven Development for recording audio

May 14, 2021 18:54 - 2 minutes - 2.59 MB

Friends I'm out and about today so we might hear some like music in the background and stuff but yeah today I wanted to talk about cypress driven development. I was working on something that I'm working on for the new website where you can submit a recording of a question and then I'll be able to answer it's gonna be really cool but it's all like in browser recording stuff and lots of what I was testing was like required me to have to record something and then to continue on through the the w...

The KCD Discord Bot "Thanks" command

May 13, 2021 21:27 - 2 minutes - 2.7 MB

Hello friends So today a friend of mine on the KCD Discord is named Rupert. I'm not sure. I'm pretty sure that's how you say their name. But I created their very first poll request for open source. I wasn't aware it's the first poll request but they did a great job. And it was for the KCD Discord bond. And so the discord has a lot of cool things you can do with it and one of them is they're a bunch of commands that you can give. One of those commands is the thanks command where you can give s...

How to prepare for meetings that convince people

May 12, 2021 15:43 - 2 minutes - 2.86 MB

So let's say that you want to convince your coworkers to try a new tech or something like a new library or whatever and you think it's a really good idea but people aren't convinced. So what typically happens is you want to prepare a couple of ideas and stuff and bring it to a meeting and say, okay, here's here's what I think and why I think this is a good idea. And then people will present their reasons why they they don't think it's a good idea. And people may come to the meeting kind of pr...

I use markdown and VSCode for slides

May 11, 2021 18:37 - 2 minutes - 2.85 MB

https://staltz.com/your-ide-as-a-presentation-tool.html Hello friends you may have noticed that sometimes I use my editor as my slides in lots of the talks that I've given over the last few years and that was originally inspired by AndrΓ© Staultz who has the a blog post on his website called your IDE as a presentation tool where he kind of explains why he has done that and it's a good blog post you can take a look at that and even gives tips on how to do this effectively and stuff. But I would...

Don't set your ref in your component body

May 10, 2021 16:05 - 2 minutes - 2.84 MB

https://epicreact.dev/the-latest-ref-pattern-in-react Hey your friends. So I get this question of fair amount and so I thought I'd try to answer it and podcast form and the question is why don't why is it not a good idea to set a ref during your render function? So there are exceptions to this and understanding the reasoning will help you understand what those exceptions are. But basically, if you read my blog post on the Epic React dot dev slash articles, there's a blog post about the latest...

Don't bring an old problem's solution to a new tool that eliminates that problem

May 08, 2021 16:42 - 2 minutes - 2.87 MB

Hey friends I had an interesting thought this morning. So a lot of people when they start using a new technology like when next was released or when you know a new version of Reactor or or any React library or whatever they often will say, okay, how do you I use this with an existing technology that I already enjoy like, so how do I use next with glamorous? That was an early thing. I remember or how do I use? Next with Jest or you know, whatever whatever it is. I would encourage you to when y...

Avoid Context Switching: Use ScriptKit.com

May 06, 2021 14:30 - 2 minutes - 2.84 MB

https://www.scriptkit.com/ https://kentcdodds.com/blog/automation Hey friends So you know how sometimes you do things so many times that you're like you know what I'm just gonna write a script for this and we'll run it and whatever and so I don't have to do this over and over again. And like some of those things can be pretty extensive, like there's a lot of stuff that you end up doing like you gotta open up this webpage and then you gotta click on that and then you gotta go do this, whatever...

Notes Driven Development

May 05, 2021 14:57 - 2 minutes - 2.71 MB

https://youtube.com/c/RyanFlorence Hey friends So I was watching a live stream from Ryan Florence last night while I was putting my kids to bed They were falling asleep and I was in the room to make sure that they didn't go all whacko and stuff while they're trying to fall asleep. And so I was just watching Ryan codeps some stuff. You should check it out. Actually Ryan has gotten some really good live streams recently, especially if you're interested in remix and stuff. And and actually somet...

Don't Solve Problems, Eliminate Them

May 04, 2021 15:00 - 2 minutes - 2.83 MB

https://twitter.com/kentcdodds/status/1388561641382420480?s=20 Hey friends So a few days ago I tweeted something about like don't solve problems you should eliminate to problems before you try to solve the problem. Something like that. And I've been thinking about this quite a bit recently and probably going to write a blog post maybe even make a talk and for this concept. But I just wanted to share with you all while I'm thinking about it and and there there are lots of examples of where eli...

Write that blog post

May 03, 2021 16:16 - 2 minutes - 2.85 MB

https://kentcdodds.com/blog/solidifying-what-you-learn Hello friends So recently somebody asked on the KCD discord whether they should bother writing a blog post because the topic had already been covered a thousand times by other people who may have more experience in whatever. And I shared with them a blog post that I wrote quite a while back called solidifying your understanding or something like that. And in it I mentioned a an interesting phenomena that I'm sure you've noticed sometimes ...

How fast touch typing helps programmers

May 01, 2021 14:57 - 2 minutes - 2.83 MB

https://www.typingtest.com/test.html?minutes=1&textfile=mediumText.txt&mode=sent&result_url=/result.html&bt=0 Hello friends. So this morning in my discord we had a little bit of a conversation about touch typing. One of my friends there asked if they should get into Vim and they were thinking that Vim you can move a little faster and well I think that's that can be true. I think there's a little bit of an illusion to moving quickly just because you're using a special text editor or editor or ...

Watch the Remix Beta Release live stream today

April 29, 2021 16:34 - 2 minutes - 2.62 MB

Live stream link: https://youtu.be/4dOAFJUOi-s Hey friends. So today is an important day for a friend of mine. Our friends of mine Michael Jackson and Ryan Florence are releasing the beta 1.0 release of remix. And if you've been watching my Twitter or just kind of me in general, I've been really excited about remix. I've been reading writing can't seedance.com to remix and it's just been a total joy. I am super excited about the potential that remakes has and really excited about the approach...

I encourage you to get into (burnout free) open source

April 28, 2021 16:25 - 2 minutes - 2.8 MB

Hey friends so I wanted to talk a little bit about open source. I have been doing open source for almost as long as I've been doing software development. And it has been just an enormous benefit to me. I I can't tell you how how much I've learned and how much of what I know I learned through open source and so I strongly advise people to get into open source for various reasons. In particular, like it makes you a better software developer, you write higher quality software, you can reuse the ...

Why I love Magic ✨ Login Links

April 27, 2021 14:41 - 2 minutes - 2.88 MB

Hey friends So I am working on a rewrite of my website can see downs.com and one thing that I'm adding is user accounts so you can set up an account and I'm not going to tell you why you might want to do that. I have a little bit of a surprise. But the reason that I mentioned this is because I'm using Firebase authentication and I started out with the username and password regular old username password sort of thing that you're used to. And it worked pretty well. I had a password reset. I had...

Use Super Simple Starts to learn new things

April 26, 2021 20:05 - 2 minutes - 2.32 MB

Hey friends So some of you may be familiar with my super simple start series of blog posts. I've got like six or seven of those and basically the idea is let's strip down everything else outside of the thing that we're trying to focus on and just bring in the abstractions or tools that are 100% necessary for whatever whatever it is we're learning and that means if we're talking about CSS variables or custom properties, that means we're not bringing in Webpack or any of that nonsense, it's all...

Trust the process

April 22, 2021 19:30 - 2 minutes - 2.77 MB

Hey folks, so today I want to talk about trust the process which I just barely looked up and apparently it's a slogan used by fans of the NBA's Philadelphia 76ers and now it's just everybody uses this and I use this and one of the things I think that I mentioned on three minutes with Kent months ago, when I started this new year one of my or my kind of goal or theme for the year was planning and the way that I executed that theme was I have a notebook and a pen that I keep in my pocket. And a...

Mock logs in tests

April 21, 2021 16:45 - 2 minutes - 2.86 MB

Hey folks So I have had a couple of in situations when I was writing some tests where I had some code that would give me some sort of warning maybe it's using the invariant module or I'm just doing a console.air or consultant more or something like that. Or maybe I'm rendering a React component that will throw an error or something like that and I want to write a test to make sure that that error is thrown or whatever. So in in these sorts of scenarios, you're going to get console.errors gett...

How to use TypeScript errors to guide your callbacks

April 19, 2021 17:13 - 2 minutes - 2.8 MB

Your friends it's a beautiful day it's Monday and I wanted to share just something that I discovered while I was working on something just kind of an interesting workflow that I've come to start to use and that is if you are trying to use something and you don't know what type it requires rather than and assuming that it's written in touch script or at least has type definitions so like say you're passing a function to an API and some sort of callback, for example, maybe you're on an input in...

Neural nets podcast recommendation

April 15, 2021 05:17 - 2 minutes - 2.19 MB

https://youtu.be/gzq5AFCH5jk Hey, you're folks. So today I listened to a podcast interview. It's about 50 minutes on. And it is on a podcast called Tesla daily. I which is a kind of interesting daily podcast about tests huh? But normally it's it's like a 15 minute long thing, but this one was 50 minutes and it was an interview with this fellow by the name of well, it's not showing the full name here. James Duma and yeah, I,Don't I've never heard of this person before but they are really great...

When to use TypeScript's `never` type

April 13, 2021 03:18 - 2 minutes - 2.87 MB

https://twitter.com/kentcdodds/status/1381453907730128900?s=20 Hey friends So last night I tweeted this TypeScript question. When have you used never in a production codebase links to examples welcome? And I failed to mute the conversation and so I ended up waking up the next morning with tons of notifications, which was great. So many people were happy to share and I just wanted to share with you a couple or the like basic themes of the different examples that people shared. So the first is ...

Make the world better by doing this one simple thing

April 11, 2021 00:06 - 2 minutes - 2.16 MB

Clickbait? Yes. Hey folks today, we're gonna go with the untraditional not tech related really podcast so I got my first dose of the modern of vaccine yesterday. I strongly advise that you do the same if you are able all of the data points to this being safe despite it how fast it was produced and everything so I if if you're not if you don't get the vaccine but you're able to then you're putting other people at more and greater risk unnecessarily so just please get the,Team let's get our liv...

Should every site be an installable PWA?

April 08, 2021 04:20 - 2 minutes - 2.82 MB

Hey there friends, so I have a question somebody's asking on the KCD office hours channel in discord and I decided this is something that I can answer in the three minutes with Kent alright podcast, so the question is what are my thoughts on PWAs nowadays should all websites be PWAs are there const making your site's PWAs so in general or to be clear a PWA stands for progressive web application and normally when we're talking about this we're talking about something that can be like installed...

Why I no longer use newspaper code structure

April 06, 2021 15:03 - 2 minutes - 2.82 MB

Hey there friends. So a while ago, I wrote well actually several years ago. I wrote a blog post called a newspaper code structure where I described the way that I like to structure my code to basically make it. I don't know easier for me to parse as I come into a new file and the idea is that anytime I have some sort of block of code that returns some value or whether that be a function or a module where your exporting values and stuff. I always,Like to do the the thing that it returns or the...

How do I add tests to existing code

April 06, 2021 02:25 - 2 minutes - 2.88 MB

So the last question in this email has to do with how do you know why where to start testing because you're adding testing to an existing project and so most of your tests are actually writing tests for code that exists and so it's not like there's no test driven development there or anything like that. And so, how do you know like how far do I go and testing when when can I stop and say that this component is tested? Does it have to do with code coverage or whatever? And my answer to that is...

Writing "Testable" React Components

April 02, 2021 21:46 - 2 minutes - 2.87 MB

Hey friends this is another answer to that lengthy email from Poeter I'm not sure how to say that but properly sorry but the question is how do you write code that can be easily tested and they go at length to explain, you know, sometimes you write, you know smaller functions and we can test those easier but ultimately like, it doesn't always work that way components typically grow and splitting them up makes it feel harder to maintain and I totally agree with that. I have a blog post called ...

How to know when you're done testing something

March 31, 2021 19:30 - 2 minutes - 2.89 MB

Hey your friends So I am going to for the next couple days answer some questions that I got in an email from somebody. I don't know how to pronounce this name. It looks like pejor or push actor. I'm not sure they're from the Netherlands. And anyway, they actually wrote me quite a nice email about testing JavaScript.com and just had some additional questions because the course mostly goes into the how to get things done and that doesn't get as much into like some of the philosoph well it actua...

Rendering react elements with ifs, ternaries, switches, or object properties

March 30, 2021 16:48 - 2 minutes - 2.88 MB

Hey there friends. So today I'm going to answer a question from Lean or Leon I'm not sure how to say your name sorry but this is asked in the react hooks channel of the discord the KCD discord under the Epic Reactive category and it's talking about exercise six where we show it's it's an exercise on managing state for asynchrony, so we've got to use effect in there and stuff. And we have this status status and that is the status of the promise. So whether it's idle pending reject,Ed or resolv...

Write the code first, then make the abstraction

March 27, 2021 03:42 - 2 minutes - 2.77 MB

CORRECTION: I came up with the concept of "AHA Programming" but I did not come up with the acronym. AHA (pronounced "Aha!" like you just made a discovery) is an acronym I got from (https://twitter.com/cherthedev/status/1112819136147742720) Cher Scarlett (https://twitter.com/cherthedev) which stands for "Avoid Hasty Abstractions." Hey friends, just something that I've been thinking about recently is this acronym that I came up with a few years ago. It's AHA and it's pronounced aha and so that'...

The future is on the edge

March 25, 2021 15:02 - 2 minutes - 2.8 MB

Hey friends the future is the edge We've got the now-fight edge thing CloudFlare workers things we want to be able to deploy our code and have it run as close to the user as possible. Before it's always just been static files that you put on a CDN like Akamai or Cloudflare or fastify or something like that because that's really easy to do. You just you deploy and then the provider will send these static files all around the world to their servers and and then users can get those files really ...

Universal remotes: So many use cases it's useless

March 23, 2021 14:56 - 2 minutes - 2.85 MB

What is up friends so this is another one in the real world programming analogies segment I guess so actually a long time ago. I wrote this down as something I could do for a blog post but you know TV remotes and how like you either have like 30 different remotes to control like your TV and the receiver and the the Chromecast, you know, like all the different and remotes that you need for that it's a disaster or you can get a universal remote. And what's interesting about universal remotes is...

Create git-ignored playground files in your project

March 22, 2021 23:01 - 2 minutes - 2.48 MB

So one thing that I do, you know, how you like you do something just you've done it forever and then when you show it to somebody they're like blown away like, oh man, what a good idea, whatever nobody is said that to me on this one but I thought I'd be one of those things that um that I just do it naturally in and you might find it to be useful so in my global git ignore for my machine. I have a pattern for ignoring anything that includes the text dot ignored dot and and so then I can create...

The Diversity of your team is a feature

March 19, 2021 15:24 - 2 minutes - 2 MB

Hey friends, so I am at ski resort in Utah right now and they have this kind of a funny story that in the bathroom they have the urinals covered up like every other one covered up for social distancing and a few weeks ago when I brought my son up here he needed to use the bathroom and all of the and he's he's kind of small so normal he just uses the pot but all of the those were being used and he really needed to go and so I was going to. Have him use the urinal but they covered up the only s...

Avoid the sunk costs fallacy

March 18, 2021 21:52 - 2 minutes - 2.25 MB

Hey friends, so I was just working on something for the last hour or so and I got to a point where I decided, you know what this I probably shouldn't be doing this like it was an optimization basically. I wanted to be able to change content on my site, so I whether it be a blog post or the about page or something like that, but not actually trigger a redeploy and I'm using GitHub actions right now for this site and there are ways that you can determine okay, what was the last successful deplo...

Books

First Things First
1 Episode

Twitter Mentions

@kentcdodds 26 Episodes
@atommorgan 1 Episode
@mwinche 1 Episode
@sarah_edo 1 Episode
@pamasaur 1 Episode
@davidkpiano 1 Episode
@bookercodes 1 Episode
@callbackwomen 1 Episode
@calltospeakers 1 Episode
@wesbos 1 Episode
@devcfp 1 Episode
@jlongster 1 Episode
@dan_abramov 1 Episode