Checkout MDN to replace boredom with learning. - a podcast by Kent C. Dodds

from 2021-02-19T00:41:26

:: ::

https://mdn.io
Hey there so today I wrote my blog post and in the process of doing that Irealized that I was doing something kind of weird. So, I have this project
that's the KCD discord bot and the bot is responsible for a whole bunch of
things that happen on my discord and it's awesome.
You'll meet the bot the it's the first thing that you experience when you
join the discord because you can't join the discord without answering the
bots questions. So I was making some changes to it and I in writing my bloganytime I write my blog. I'm always going to be writing about something
that I'm working on recently or something.
I've been.Thinking about a lot recently or whatever. And so I found some
code that I'd written in the bot and for a listifying an array of elements
for display. So you'd say, you know, we have a thanks command so you can
think a list of developers for a specific thing and we want to have the botsay thank you these list of developers for or these list of people for this
thing.So you have to have the common the right place you need to and whatever.
And so I decided hey, I'll just explain how I wrote this because it was
using a reduced and it was.Actually really interesting and good use casefor reduced because the doing the same thing with a for loop was kind of
more complicated.And so I was writing it and then I remembered oh yeah, there's like a
built-in thing and in the in toll library built into JavaScript forformatting a list. And I think I probably used that or at least explain
that and then explain why I needed to write this thing myself.And as I was writing the blog post, I realized I didn't need to write the
listified function myself or at least I didn't need to write the inner
workings of it. I could just wrap theList format utility that's built into
the Intel API in JavaScript. And so, I I tried that out and it ended upworking and so what I wanted to share with you today was that sometimes you
might be doing more work than you need to because the platform alreadygives you a lot of really interesting things and especially the Intel API
has a lot to offer that I find myself and others re-implementing like whenit comes to dates and stuff like that too like formatting things for
display is a lot of what the Intel API.Allows you to do So that would be something to go give a look at it's kind
of interesting and yeah, sometimes the platform is lacking in certain waysbut often like this is platform that we build on is pretty capable and
there are a lot of really cool things that it can do and spending some timeon MDN is a good use of your time.
So next time you're stuck in a checkout line or something if you do that
thing during coffee I guess but next time you're you're stuck in a line or
or just waiting for something go check out FDN and look up some stuff youhaven't learned before. It's aGood spot.
See ya.

Further episodes of 3 Minutes with Kent

Further podcasts by Kent C. Dodds

Website of Kent C. Dodds