Object Oriented vs Functional Programming with TypeScript

preview_player
Показать описание
Learn how object-oriented 🎁 and functional ❄️ programming are awesome in their own ways. Also, get infallible answers answers to questions like "composition over inheritance?", "GIF over JIF?", "Is a hotdog a sandwich?" and more!

Special Thanks to Patrick Mullot - you rock!

Рекомендации по теме
Комментарии
Автор

Ironic naming when SuperHuman is a subclass of Human and Human is its superclass lol

TheFeriner
Автор

🚨 Warning 🚨. This video makes an attempt at sarcasm in the first 60 seconds. Watch the chat replay above for the full experience

Fireship
Автор

This mostly depends on what you are doing right now. OOP is better for making closed complex systems and FP is better for universal multipurpose code. From my experience It's best to mix them, I believe it works very nice combined.

idedary
Автор

I love how you talk fast enough so that I don't have to set the speed to 1.25. <3

osmankirpat
Автор

The metaphor about the sandwich and the hotdog was brilhant! You guys are Genius, I love this channel, thanks a lot for share it!

jonatangall
Автор

What’s better, oop or procedural?

Answer: yes

slapmyfunkybass
Автор

I have worked with React for several years. My life totally changed embracing composition. I am very happy not haven't written a loop in some years. But the one of the points where composition win over inheritance is testability, which is something I put a lot of focus into. That's my personal opinion from experience of course. If oop is more of cup of tea great. I love that we can choose

victorlongon
Автор

Not a TypeScript coder ( yet ), but definitely helped me get a more flexible understanding of OOP. Thanks!

SaifUlIslam-dbnu
Автор

I like how you took something trivial like the hotdog question and wrapped it in with the theme and made it relevant.

kevingarubba
Автор

Holy shit. That's really well-composed episode. Congrats man and goodluck in 2019!

DEVDerr
Автор

The sarcasm at the beginning though lol.

davidtheprogrammer
Автор

There is always going to be a bunch of ways to solve a problem, but CERTAIN programming paradigms are better for CERTAIN problems. It's not really a gif jif thing, its more of a use the best case solution for your problem.

JonathanCGroberg
Автор

It took me almost a hour and a half to get through this while rubber ducking the ideas and taking notes to make sure I take everything in, but it made everything super understandable. Thank you!

PeepingOtterBot
Автор

Thanks for all of the videos this year!

Kevin
Автор

Thank you so friggin much. I just wanted to pick up typescript and i found your channel. Now i have a broad idea on how typescript works and i finally understood how the idea of Interfaces actually work out. Kudos! :)

arcane
Автор

OOP gets messy when there is a process of data transformation involved. Should the process be a singleton? Should static function be introduced? But wait, why class static members and not plain functions?

kahnfatman
Автор

1) i believe this was answered in a different video, but you can make functions private and protected in a class, correct? i don’t recall seeing that in this one.
2) how are you making it auto fill your return statement? that would be such a time saver!
3) nested classes get tricky in any language. The deepest i’ve gone and think i’d ever go is a sub class of a sub class of a class.

cfmvalizan
Автор

3 years old vid that is still spot on and very informative. Thanks! 👌

stephane
Автор

Functional object oriented programming of course. While individually they are both great, they are exponential better when combined correctly.

mageover
Автор

Nice but you've got Composition vs Inheritance convoluted yourself. You're right that, they are not a choice for example a Tshirt vs Trouser where in upper body scenario you'd apply T-shirt and for lower body a trousers. But then when you go on to say that composition is another way for reusability, one could get an idea that it might be used interchangeably with inheritance which is not right. On the contrary, there might be scenarios where you'd need both.

Here's an example for inheritance; Shark and Dolphin can be inherited from a base class of Fish.

For composition, we can make a Fish class by composing it from a Fin and a Gill class in addition to it being inherited from Animal class.

babablacksheep