TypeScript Tutorial #15 - Interfaces

  Рет қаралды 157,352

Net Ninja

Net Ninja

Күн бұрын

Пікірлер: 48
@Oswee
@Oswee 4 жыл бұрын
You should mention about Interfaces vs Types so that people do not get confused later. :) And in oposite. Mention Interfaces when talking about Type.
@joaopedroschmitt1112
@joaopedroschmitt1112 2 жыл бұрын
I think interfaces intention is not about class structure only, but about creating an abstraction (contract) between two domains that allow you to decouple one part from another by not requiring one part to understand the details of the implementation. A better explanation can be found by searching for the principles of Dependency Inversion, or, Dependency Injection. Interfaces is an essential tool for polymorphism
@ardavanansari
@ardavanansari 4 жыл бұрын
first thing I do before watching a NetNinja video : hit the like button
@meylis_so2
@meylis_so2 6 ай бұрын
and yours also
@pulkitaggarwal1931
@pulkitaggarwal1931 4 жыл бұрын
Hi, Could you please elaborate difference b/w interface and type for defining any type like isPerson in this video
@chiubaca
@chiubaca 4 жыл бұрын
its confusing... Summary from - medium.com/@martin_hotell/interface-vs-type-alias-in-typescript-2-7-2a8f1777af4c - type aliases can act sort of like interfaces, however, there are 3 important differences ( union types, declaration merging) - use whatever suites you and your team, just be consistent - always use interface for public API's definition when authoring a library or 3rd party ambient type definitions - consider using type for your React Component Props and State
@helengu
@helengu 4 жыл бұрын
you can redeclare interfaces multiple times and merge them together.
@Shakeel714
@Shakeel714 3 жыл бұрын
Thanks Shaun for the wonderful tutorial series.
@boykasarboo9432
@boykasarboo9432 2 жыл бұрын
Hi! bro you are one of my favorite teachers..Stay blessed..
@rahulyavvari
@rahulyavvari 8 ай бұрын
Shaun is the best! @1:23 Maybe we have a method speak, cz people speak (lol : ) )
@eggziom
@eggziom 2 жыл бұрын
Found naming interfaces a little bit confusing in the tutorial An interface basically describes functionality the object must have so you can interact with it. "Is-something" sounds more how you should name a type guard. I personally prefer just "Person". In the wild, you also may come across a convention to precede interface names with "I" (from "interface"; "IPerson"), like it was popular in Java, for example
@potantirittisak8494
@potantirittisak8494 Жыл бұрын
Very clear. Thank you!
@victoradeniji4554
@victoradeniji4554 Жыл бұрын
Thank you so much for this. Thank you.
@NetNinja
@NetNinja Жыл бұрын
No worries! :) thanks for watching
@Pylogicx
@Pylogicx Жыл бұрын
Thanks, a lot. You have saved me time.
@AnweshAdhikari
@AnweshAdhikari Жыл бұрын
Thanks, this helped!❤
@NikiL2134
@NikiL2134 4 жыл бұрын
Why wouldn't I just create a type alias of an object with these properties?
@mohdkamran530
@mohdkamran530 2 жыл бұрын
Same question
@andikasaputra1390
@andikasaputra1390 4 жыл бұрын
So, what is the difference between type & interface?
@samuelopeyemi8377
@samuelopeyemi8377 3 жыл бұрын
Type is what typescript infered or inbuilt type you declear e.g number, string. While interface is your custom type that doesn't come with TypeScript
@itaibiton9068
@itaibiton9068 3 жыл бұрын
@@samuelopeyemi8377 yea but you can also create types
@usama_khalid
@usama_khalid 4 жыл бұрын
your videos are great. i have a request - please make videos on Nuxt js (Vue ssr)
@cyanfroste5559
@cyanfroste5559 4 жыл бұрын
interfaces are mostly used with classes to define a class, but in js, classes are just glorified objects. so the differences are very small.
@gaddiji
@gaddiji Жыл бұрын
can you explain me Interfaces, i cant understand wth is this..
@mylesdavies9476
@mylesdavies9476 Жыл бұрын
It's odd that you can't extend the object with additional properties. Surely as long as it still satisfies the interface, additional properties shouldn't be a problem. This would be allowed in C# for example and would be very common, for example an object implementing multiple interfaces through a range of different properties and methods.
@matheuscampos2566
@matheuscampos2566 2 жыл бұрын
great... tnx
@crucru4000
@crucru4000 2 жыл бұрын
Which syntax highlighter do you have enabled here? very cool
@avtheprowd
@avtheprowd 5 ай бұрын
Did you find it ?
@nomads_._land
@nomads_._land 5 ай бұрын
@@avtheprowd That was me 2 years ago haha. No, but I use synthwave80 on vscode for everything except solidity :)
@avtheprowd
@avtheprowd 5 ай бұрын
@@nomads_._land On which domain are you working on this days ?
@Santix_Oficial
@Santix_Oficial 4 жыл бұрын
I have an Issue at compile time Uncaught ReferenceError: exports is not defined at my app.js file on the line Object.defineProperty(exports, "__esModule", { value: true }); someone help me please.
@loba8924
@loba8924 2 жыл бұрын
Thanks
@bouamarelouahhabi9525
@bouamarelouahhabi9525 4 жыл бұрын
I hope after this series you do another one about mern or mevn stack with typescript (a big one, it could be in udemy), you're the best man!
@avigarg3357
@avigarg3357 Жыл бұрын
how can we use pick utility type on new someone person you made from same interface"inperson"
@priyojitsingha
@priyojitsingha 10 ай бұрын
So interfaces can be considered as schemas for a object, am I right?
@AP-no6uc
@AP-no6uc 3 жыл бұрын
Hello! Can you tell me please which color theme you use in VS Code? it looks nice.
@TheMisieq93
@TheMisieq93 3 жыл бұрын
I think he uses Monokai++
@R_Samnan
@R_Samnan 4 жыл бұрын
Super cool
@johnconnor9787
@johnconnor9787 Жыл бұрын
What is the difference between Interface and Type aliases?
@Djinn667
@Djinn667 2 жыл бұрын
This is similar to classes in C++
@zes7215
@zes7215 2 жыл бұрын
wrg, sx any nmw and any s perfx, not stringx etc
@Mikevets
@Mikevets 2 жыл бұрын
How is Interface different from Type Alias?
@ridl27
@ridl27 4 жыл бұрын
ty.
@amanin4326
@amanin4326 4 жыл бұрын
whatsup with the 30 man ?
@vaibhavshukl8265
@vaibhavshukl8265 4 жыл бұрын
Can you make one series on Wordpress and one on Native android development using Kotlin?
@aayushkumarthakur3095
@aayushkumarthakur3095 3 жыл бұрын
Make a method speak because people do speak 🙂
@imdeadserious6102
@imdeadserious6102 Ай бұрын
When you're taught that JS has nothing to do with Java, then JS becomes Typescript and as close to Java as it can be... I really don't like typescript... but full stack school. yay
@ademineshat
@ademineshat 4 жыл бұрын
Are you really 30? 😂
TypeScript Tutorial #16 - Interfaces with Classes
11:09
Net Ninja
Рет қаралды 111 М.
TypeScript Tutorial for Beginners
1:04:28
Programming with Mosh
Рет қаралды 1,4 МЛН
TypeScript Tutorial #18 - Generics
9:44
Net Ninja
Рет қаралды 120 М.
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 903 М.
Why use Type and not Interface in TypeScript
14:12
ByteGrad
Рет қаралды 218 М.
TypeScript Interfaces vs Types
13:59
Harry Wolff
Рет қаралды 89 М.
STOP Using Classes In JavaScript | Prime Reacts
14:02
ThePrimeTime
Рет қаралды 256 М.
Golang: The Last Interface Explanation You'll Ever Need
17:58
Flo Woelki
Рет қаралды 26 М.
Vite Crash Course | Faster Alternative To CRA
16:24
Traversy Media
Рет қаралды 218 М.
Typescript Generics Tutorial
21:56
Ben Awad
Рет қаралды 219 М.
TypeScript - The Basics
12:01
Fireship
Рет қаралды 1,5 МЛН