3 Minutes With Kent

Informações:

Synopsis

Hi there! I'm Kent (https://twitter.com/kentcdodds) and on this podcast I share a thought or two of things that I've found to be useful in my journey as a web developer. You can subscribe on iTunes here: http://kcd.im/3-mins-itunes and on RSS here: http://kcd.im/3-mins-rss

Episodes

  • I use markdown and VSCode for slides

    11/05/2021 Duration: 02min

    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 just thought I'd mention why I like doing this. I actually am working on some slides right now for.A talk that I'm giving and I I've gone through so many different ways of making slides like I started with you know, Google Drive and or PowerPoint and and went on to I actually used Prezi for a while which was fun and and slides.com is probably where most of my slides are and I really like that one quite a bit. I've made things simple. I used MDX deck tried to code my slides. And finally, I've kind of landed at using my ed

  • Don't set your ref in your component body

    10/05/2021 Duration: 02min

    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 ref pattern and in that I put a use layout effect and,There with ref dot current equals some callback or whatever And a lot of people ask me why do you need to put that in a use effect? Why can't you just put that? You know you're calling it every render anyway so you may as well just put it directly in the render function. So the reason that you don't want to do this is it actually is mostly just for future proofing. So right now that will technically work and it and it there shouldn't be any problem with it, but when e

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

    08/05/2021 Duration: 02min

    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 you're using anNew technology to avoid bringing in your previous and older or like the the previous technologies that you were using in conjunction with this new thing too early. So what I mean by that is often we get really that we're using an existing thing and say we're using create react app. And we really like emotion for our styling. And so then we decide okay, I'm gonna switch over to a remix from Create. React app and I'm gonna say okay now I really like emotion for my styling so I'm gonna come in to. That and try

  • Avoid Context Switching: Use ScriptKit.com

    06/05/2021 Duration: 02min

    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. And some of those things can be like really simple. So I just need to open this file add a line to this and save it and then close my editor or whatever. And you can speed all of those things up using like little CLI to.Pull that you make or something and the the value of this isn't necessarily in the amount of time that it saves you but in the amount of context switching it saves you from. So so you don't have to pull up your whole editor, you don't need to pull up this tab or whatever it is. I actually have a blog pos

  • Notes Driven Development

    05/05/2021 Duration: 02min

    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 sometimes I'll just watch it during the day. I'll just have it on in a different tab while I'm working and if I hear something that sounds interesting I can go over there. So, it's kind of fun and interesting.And and yeah it's kind of fun to be on this side of the live streaming stuff at home but anyway one thing that I noticed that Ryan doesn't and I've seen him do this any time that I've seen him code not just in this livestream. So he's been doing this for a while as far as I know. But he has this document open in his edito

  • Don't Solve Problems, Eliminate Them

    04/05/2021 Duration: 02min

    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 eliminating a problem was much better than trying to find a solution to the problem. And you can find these as.Sorts of examples in real life as well as in programming. So like an example in real life and actually I was watching a video about this this is what kind of made me start thinking about this was Tesla how they eliminated a ton of problems with gas-powered vehicles by making an electric vehicle. And so we no longer have I mean and we kind of create new categories of problems that we need to solve but by taking a com

  • Write that blog post

    03/05/2021 Duration: 02min

    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 you will be walking down the street and you'll see there's a McDonald's I really like a burger or whatever but then right.Next to it, you'll see a burger king. And then like we wonder sometimes like why would Burger King put a building here if there's a McDonald's right next door like they already solved the I need a burger problem why why would they bother doing that? And the reason is because people's taste are different and people enjoy the the burgers, you know, or whatever quizzing you want to use as an analogy here.

  • How fast touch typing helps programmers

    01/05/2021 Duration: 02min

    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 a VIM like key bindings thing. I think you can get just as fast without them. And I've been on both sides, but yeah, andNow I'm not using them keen bitings But anyway I think, we kind of came around to touch typing was the thing that was selling them down. They could improve their speed if they just were able to type a little faster. And so I thought yeah, I just got me thinking this morning about how valuable it can be to be able to type very quickly. I think most of us have been in a situation where the interface to the

  • Watch the Remix Beta Release live stream today

    29/04/2021 Duration: 02min

    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 that they're taking and.From a progressive web app standpoint whatever So if you're listening to this on the same day that I'm recording it then don't miss their live stream that's happening later today because it's going to be great. I'm certain of it like they haven't given me a preview or anything but I'm sure it's going to be great. And I really encourage you to give some serious thought to remix as an option for the apps that you build in the future because it's phenomenal. The their approach to focusing on the foun

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

    28/04/2021 Duration: 02min

    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 software that you create.In a other projects and so yeah it's a lot of fun to get involved but a lot of people ask me how well there's there's two sides of this how do I get started and then how do I make sure I avoid burnout as that is the thing that happens for open source developers. It's a pretty thankless job in general like that, you don't get financially compensated most of the time and stuff. So first of all how to get involved. I have a blog post that goes into more depth on this. It's called what open search pro

  • Why I love Magic ✨ Login Links

    27/04/2021 Duration: 02min

    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 forgot my password. I had changed password and updated email all that stuff was all implemented butIn as I was working on all of this I started to I think personally I actually really like the magic link for stuff because for various reasons it's it's incredibly more secure. So like if I were to have a data breach which of course, it wouldn't be me it would be Firebase I would have the data breach. So, I'm not really worried about that. But if that were to happen or rather for services that I use I prefer and that they u

  • Use Super Simple Starts to learn new things

    26/04/2021 Duration: 02min

    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 just index HTML and then style sheets and stuff. And we're talking about react same story. We get rid of the build tools just get rid of all of that stuff and see how minimal we can make something work just kind of the hello world of this. We we don't care about whether this solution scales or anything and the idea is if we can separate the specific thing that we're trying to learn from all the extra things you need around it to make something practical you'll understand a lot more what the the role of that thing that yo

  • Trust the process

    22/04/2021 Duration: 02min

    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 at the beginning of the day I'll just look at my calendar and the things that I'm I need to do or maybe at the end of the day for the day the next day and I write down a list of all the things I want to get accomplished and so far this year. I've done a really good job of keeping up with that process it's worked out pretty well. I had slipped up a couple times for like when we do spring break and stuff with the kids, but for the most part I've been doing this really well and it's worked out just phenomenally so I it's a pr

  • Mock logs in tests

    21/04/2021 Duration: 02min

    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 getting logged. And so, I just wanted to talk about how I do that. So what I do,Is I am I do just that spy on console error and do that in a before each and then inside the test itself. I will define what I want it to be mocked as and I don't want to have my tests muddied up by all the console output from my source. So whether that's console.org, or error or log or anything, I want my test to be totally free of all of those things. And so if I'm expecting to have some logs of some kind as I'm running my tests, I'm going to ne

  • How to use TypeScript errors to guide your callbacks

    19/04/2021 Duration: 02min

    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 a j in your JSX and you have an on change in your not sure what type. The event should be or that first argument or you don't even know whether it accepts arguments or anything so the way that I do this is rather than opening up the docks and digging around and trying to find how this is to find out what I'm expected to do here you put in a function that you're pretty confident is going to break the types in some way and so for our input on change example, you can just put an inline function in there that takes a single

  • Neural nets podcast recommendation

    15/04/2021 Duration: 02min

    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 at explaining neural nets and so I wanted to share this with you wanted to um, just encourage you to go give it a listen. Some of it was like hmm, I'm not sure I get this but after like thinking about it more and and listening carefully to that James explain it, um, I I feel like I have a much better understanding of neural nets now than I did before and I thought that you all find that to be kind of interesting, so I'm gonna include a link to theIt's on YouTube I I'm guessing this is also gonna be published as part of t

  • When to use TypeScript's `never` type

    13/04/2021 Duration: 02min

    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 discriminating union. Oh and by the way, if you've never heard of never before the basic idea is it's a way for you to say.Hey the type script type checker as it's flowing through the types of my application, it should never be able to hit this type. So it's like those situations where you like this should never happen. That's basically when you use never. So anyway, the first is discriminating unions and a common example for this was if you had a component that could take a variety of different props. So an example is a

  • Make the world better by doing this one simple thing

    11/04/2021 Duration: 02min

    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 lives back to as normal as we can so we can work on all the other terrible things that we need to work on and focus our energy on making the world a better place and yeah just for me this first dose has been this morning. I woke up feeling like I got hit in the in the arm really hard and so it felt kind of bruised and then I felt fine and right now I'm writing around on my one wheel so I I'm not super terrible but I am feeling a little achy and that sort of thing. I hear that the second dose is work.S and so we will see what

  • Should every site be an installable PWA?

    08/04/2021 Duration: 02min

    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. You can have background notification like push notifications and stuff like that works offline, in fact Chrome recently started requiring or is going to require offline functionality to be present for your app to be installable as a PWA, so I have actually had my website installable as a PWA before and I've had a couple other a little apps or sites that I've made PWAs installable and it's kind of cool. I would caution people against just saying let's make everything a PWA because I have had some sad experiences with ser

  • Why I no longer use newspaper code structure

    06/04/2021 Duration: 02min

    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 exports at the very top of the file and the reason for this is in a newspaper article and they make it they write it so that they add just kind of a high level first and then they slowly fill in with details and the reason they do that is so or at least maybe they used to do that this way is so that you could clip the article at any point to size it for where it needs to be and it would still be coherent to make sense. And in the same way I like to make my code so that it makes sense.Reading from the top down and if you

page 2 from 12