3 Minutes with Kent

List out different things that appear to do the same thing


Listen Later

Hey friends so I'm rendering a blog post today and I learned to something

that, I thought you might find interesting. I'm not specifically the thing
that I learned but just the thing that I learned about when you're trying
to teach something. Anyway, so the if you're entering something new you're
getting into a new space and and there are a lot of things that seem
similar to you and you're like, I don't know what to use this or that or
whatever and they just seem like they satisfied same use cases.

It can be really useful to list out and kind of try to categorize all of

those.At a different use cases or the different things that seem similar So
specifically I'm talking about functions with type script. Now with regular
JavaScript, there are lots of different ways to write functions, you've got
properties on objects, you have methods on objects you have class methods.

You have arrow functions. You have function declarations and expressions

and so there are a lot of different ways to write functions and then you
add typescript on top of that and you can write a typing for a function and
then you can add that as an annotation on a function expression.

Lots of different ways to.Type these things too And so it was just kind of

boggling my mind and so I'm just listing them all out here are all the
different ways to write functions and type script. And I'm learning that
there are certain realizations that kind of come upon you as you're
listening these things out.

Some things that you hadn't really considered and you get a better

understanding or at least I'm getting a better understanding of when these
different things are necessary or useful and then when you're all done, you
have a reference to to go luck and you say, oh I need to do this.

I remember that's like one of the ways that I read.A function whatever so

I'll just go look at that reference that I wrote And there may be
references sort of like this in existence In fact, I'm looking at the
TypeScript Docs right now that talk about functions and it does have some
of the stuff but writing it yourself you you come up with your own examples
and and you think about things done a little different way.

It just there's something to be said about the process of creating this

content that helps you really solidify it a lot better. So that's what I
would suggest to you if you're entering something new or maybe even
something old I've been using TypeScript for a lot.Of time. This is always
bugged me.

So you're just like not super solid on something especially when there

multiple ways to do the same thing and you're not sure about the use cases
for those different ways. Try to list them out and you could do this in a
box post or just in your own notes, but try to list out all of the
different ways to do the same thing and you'll learn different things about
them.

I hope that's helpful and I hope you have a fabulous awesome day Ciao.

...more
View all episodesView all episodes
Download on the App Store

3 Minutes with KentBy Kent C. Dodds

  • 5
  • 5
  • 5
  • 5
  • 5

5

4 ratings