High Definition Standard Definition Theater
Video id : jJGzYdS4ZfY
ImmersiveAmbientModecolor: #a99181 (color 2)
Video Format : (720p) openh264 ( https://github.com/cisco/openh264) mp4a.40.2 | 44100Hz
Audio Format: 140 ( High )
PokeTubeEncryptID: 24fe04c30b7828aa29f21ebead4286edb055ebc9473a4e502bfcceb10272ed269e83c914e0ab5fd18e53676974b6ea14
Proxy : usa-proxy2.poketube.fun - refresh the page to change the proxy location
Date : 1727531280381 - unknown on Apple WebKit
Mystery text : akpHellkUzRaZlkgaSAgbG92ICB1IHVzYS1wcm94eTIucG9rZXR1YmUuZnVu
143 : true
You Should Be Using Types Instead Of Interfaces In TypeScript
 60 FPS video
55,792 Views • Dec 21, 2023 • Click to toggle off description
Metadata And Engagement

Views : 55,792
Genre:
Uploaded At Dec 21, 2023 ^^


warning: returnyoutubedislikes may not be accurate, this is just an estiment ehe :3
Rating : 4.91 (66/2,873 LTDR)

97.75% of the users lieked the video!!
2.25% of the users dislieked the video!!
User score: 96.63- Overwhelmingly Positive

RYD date created : 2024-09-19T17:25:27.645176Z
See in json
Tags
Connections
Nyo connections found on the description ;_; report an issue lol

YouTube Comments - 60 Comments

Top Comments of this video!! :3

@fabien-bouvier

9 months ago

The semantic behind interfaces is to describe an object behavior contract. It's an OOP concept. A class can implement several interfaces. It kinda solves the unique inheritance limitation and allows to write very generic code by expanding Liskov Substitution capabilities in OOP.

This why you should use interfaces. For everything else, use types. The right tool for the right job. Both have their purpose.

12 |

@ChrisVisserDev

9 months ago

Conclusion. Use the right tool for the job. There are situations where interfaces make more sense and situations where types make more sense. However types are best as default unless you need specific features from the interfaces

20 |

@harleyspeedthrust4013

3 months ago

interface declaration merging goes hand in hand with module augmentation. some examples:
- defining custom matchers in jest
- correcting a type in an upstream package
- defining custom jsx elements
- convenient global types for modules - e.x. Express.User, which is the type of req.user in an express app. You can extend this type to add your own properties to req.user. This is similar to the jest example

IMO types are usually better but sometimes your problem can only be solved with an interface, and sometimes you are defining some type that classes shoulr conform to (a proper OOP "interface").

1 |

@Saru-Dono

9 months ago

Don't approach this as black and white, it's fine to use both. I personally use Interfaces for defining objects(ie. React component's props) and Types for pretty much everything else.

8 |

@md.redwanhossain6288

9 months ago

Interfaces are for OOP , types are for making types. Don't mix and match both.

108 |

@nomadshiba

9 months ago

also interfaces lets you use the `this` keyword.
which is useful sometimes

10 |

9 months ago

This is something like; don't wear sweater. wear shirt instead.

9 |

@HaiNguyen-cf1ji

2 months ago

Interface can use union as well. In fact typescript docs it self said that you should perfer interface over type since it give more info when you hover over the thing that use interface, I think typescript should merge the two to remove these kind of debate

|

@hugodsa89

9 months ago

Interfaces can be extended. They are also technically not as heavy on the ts server

14 |

@jackdavenport5011

8 months ago

I mainly use interfaces for defining objects but types for defining literals or tuples. They both have their uses :)

|

@agiamahprecious9901

9 months ago

eslint would scream at seeing two interfaces with same name

1 |

@blenderpanzi

9 months ago

You can do unions like that with interfaces, too. WTF are you talking about? The adding props thing is valid.

4 |

@sircharlesross537

8 months ago

Use interfaces until you need types (eg extends or literal values)

|

@DaaWood998

9 months ago

I only use types when I have to. In 90% of cases in frontend components

1 |

@JlNGLEZ

9 months ago

There's absolutely nothing wrong with using either type or interfaces or a combination of both, im sick of seeing these blanket statement types of videos, using whatever you like to suit your purpose. It really does not matter at all, if you disagree with me, give me one downside....

11 |

@dylanthony1

9 months ago

You can do this with inheritance though? Like have a parent interface of mammal and then have the person interface or animal interface inherit from mammal.

|

@alimodz6253

8 months ago

how do you use “extends” with interface?

|

@sney2002

9 months ago

So now I have to check which type of mammal I have any time I use it?

|

@LlegoManuel

8 months ago

Reason #4: Is TypeScript, no InterfaceScript

|

@ShadowD2C

8 months ago

Is types like struct in golang?

|

Go To Top