Тёмный

Composition over Inheritance Explained by Games!  

Metaphorically Speaking
Подписаться 3,4 тыс.
Просмотров 12 тыс.
50% 1

Опубликовано:

 

3 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 57   
@metaphoricallyspeaking
@metaphoricallyspeaking 7 месяцев назад
Prefer a written version? There is a visually-explained post on my blog: acairns.co.uk/posts/composition-over-inheritance Disagree? Got feedback? Let me know below, or jump on Discord: acairns.co.uk/discord
@DUHRIZEO
@DUHRIZEO 2 месяца назад
Whoa. The "has a" vs "is a" statement flipped the missing switch in my brain. You rock brother.
@metaphoricallyspeaking
@metaphoricallyspeaking 2 месяца назад
Thank you - glad I could help you build a mental model of Composition over Inheritance! 💪
@coderized
@coderized 4 месяца назад
Fantastic video! Loved the design, graphics, editing and relatable gaming analogies throughout. Honestly, top work!
@metaphoricallyspeaking
@metaphoricallyspeaking 4 месяца назад
Much appreciated - glad you enjoyed it! :D
@cosmotect
@cosmotect 6 дней назад
As a non coder working with visual scripting languages I have been discovering these concepts by myself, and it's quite rewarding to see my suspisions confirmed by someone more knowledgable
@metaphoricallyspeaking
@metaphoricallyspeaking 5 дней назад
Amazing. Thanks for sharing!
@kodacoda
@kodacoda 8 месяцев назад
this video has so much style, I love it, keep up the good work ;)
@metaphoricallyspeaking
@metaphoricallyspeaking 8 месяцев назад
Thanks Kari, appreciate it. Will try! 😅
@WalterGordyCanada
@WalterGordyCanada 8 месяцев назад
Love the style for sure! The ad threw me for a loop though. I thought I had click out of the video by accident.
@metaphoricallyspeaking
@metaphoricallyspeaking 8 месяцев назад
Unfortunately I haven't reached the dizzying heights RU-vid have set for monetisation and can't control when the ads show 😢 One day, maybe... Glad you enjoyed it, though!
@tobiasmercader8091
@tobiasmercader8091 3 месяца назад
first time watching one of your videos, and honestly im impressed. I hope this goes well for you so that i can enjoy these videos in the fututre and so that you can improve even more the quality.
@metaphoricallyspeaking
@metaphoricallyspeaking 3 месяца назад
Thank you so much for the encouragement Tobias!
@init_bobjames
@init_bobjames 6 месяцев назад
Fantastic production quality and excellent teaching skills. Great work 👏👏
@metaphoricallyspeaking
@metaphoricallyspeaking 6 месяцев назад
Thanks for the kind words, Bob - glad you enjoyed it! 😊
@stephensamra
@stephensamra 8 месяцев назад
I really enjoyed this one, especially the animation. Great work.
@metaphoricallyspeaking
@metaphoricallyspeaking 8 месяцев назад
Thank you Stephen. Glad you enjoyed it!!
@alexMKDtheBEST
@alexMKDtheBEST 2 месяца назад
This was such a cool and beautiful video! I'm probably gonna binge all your videos when I get back from work later
@metaphoricallyspeaking
@metaphoricallyspeaking 2 месяца назад
Thank you. Hope you enjoy - new video is almost done, too!
@quetzalcoatl-pl
@quetzalcoatl-pl 8 месяцев назад
5:07 - oh yes, bonus point for you and scott
@metaphoricallyspeaking
@metaphoricallyspeaking 8 месяцев назад
Scott is incredible. And his cinematography is at such a high standard. His drawer organiser video made me impulse-purchase a 3d printer.
@davecollett3497
@davecollett3497 4 месяца назад
Refreshing to hear real world advice, rather than the usual "always do this" nonsense. Just because a toolset has a tool, doesn't mean should or shouldn't use it. Tools are not good or bad by themselves, but using a hammer for a screw is a bad idea. Great content
@metaphoricallyspeaking
@metaphoricallyspeaking 4 месяца назад
Thanks Dave, Glad you enjoyed the video! Nothing is black and white - just lots of different shades of grey in different contexts. It's our jobs as engineers to understand the tradeoffs and make the best decision with the information we have. Also, I just recently used the hammer/nail metaphor in an article! 🤣 acairns.co.uk/posts/primitive-obsession
@takapapatapaka5326
@takapapatapaka5326 Месяц назад
That's a great video, nice explanation and incredible visuals ! Thanks for sharing you amazing work
@metaphoricallyspeaking
@metaphoricallyspeaking Месяц назад
Thank you! Glad you liked it!
@abuyusufalfawzan
@abuyusufalfawzan 8 месяцев назад
Very interesting insights, keep it up! Subscribed.
@metaphoricallyspeaking
@metaphoricallyspeaking 8 месяцев назад
Thank you. I'll try! 😅 Welcome aboard! 😁
@elatronion
@elatronion Месяц назад
SuperMario is a Mario. Mario: It's a me?
@metaphoricallyspeaking
@metaphoricallyspeaking Месяц назад
It's a you! 😆
@steve_rico
@steve_rico 2 месяца назад
Amazing explanation
@metaphoricallyspeaking
@metaphoricallyspeaking 2 месяца назад
Thanks Steve - glad you liked it!
@cariyaputta
@cariyaputta 2 месяца назад
Nice explanation.
@metaphoricallyspeaking
@metaphoricallyspeaking 2 месяца назад
Glad you liked it :)
@pindab0ter
@pindab0ter 6 месяцев назад
This is amazing stuff!
@metaphoricallyspeaking
@metaphoricallyspeaking 6 месяцев назад
Thank you! ☺️
@pindab0ter
@pindab0ter 6 месяцев назад
@@metaphoricallyspeaking I do think there’s a market for accessible and engaging explanations of software engineering concepts. Looks like you’ve got it nailed down. Instantly subscribed!
@metaphoricallyspeaking
@metaphoricallyspeaking 6 месяцев назад
@@pindab0ter Thank you. Thanks for the kind words! :D Not nailed down at all, I'm afraid. Learning a lot as I go! Haha
@pindab0ter
@pindab0ter 6 месяцев назад
@@metaphoricallyspeaking the combination of your voice, your visual style and the fact that you’re covering not beginner but intermediate topics make me look forward to you future videos!
@codeik0
@codeik0 7 месяцев назад
The graphic design is crazy. Easy sub earn
@metaphoricallyspeaking
@metaphoricallyspeaking 7 месяцев назад
Awesome. Really glad you enjoyed it! :)
@dragonfiregaming4427
@dragonfiregaming4427 8 месяцев назад
@ThePrimeTimeagen We need your reaction. Primeagen approved or nah?
@dragonfiregaming4427
@dragonfiregaming4427 8 месяцев назад
This was a great video @metaphoricallyspeaking. Keep up the great work!
@metaphoricallyspeaking
@metaphoricallyspeaking 8 месяцев назад
I would be proud and terrified - in equal measures! But, if he were to roast the video, at least I could take the low-road and mock his hair! 😁
@metaphoricallyspeaking
@metaphoricallyspeaking 8 месяцев назад
Appreciate the kind words. Will certainly try! :)
@frostyrobot7689
@frostyrobot7689 8 месяцев назад
Nice. Subscribed.
@metaphoricallyspeaking
@metaphoricallyspeaking 8 месяцев назад
Appreciate it 🙌
@valseedian
@valseedian 8 месяцев назад
haven't watched the video yet, just wanted to say I (a 20yr veteran programmer) just learned about the concept a few weeks ago, though I've been an unknown advocate and practitioner of composition since being introduced to requisite oop in Java in high-school. I've carried the notion through all my projects since. always thought inheritance was a bad idea outside of strict polymorphic virtual functors where you can leverage the compiler to produce code states nessesary vs boilerplate every time a new instance is found. templating in c++ does exactly this for functional and procedural bros ok, watched the video. that last sentence "use inheritance when it exists in that domain" is basically saying the same thing. nothing in the real world actually does this. the nature of reality is to have many close but independently unique variants with- at best- partial heredity on average due to the imperfect copy problem. practically nothing is perfectly all of one other thing plus new stuff.
@metaphoricallyspeaking
@metaphoricallyspeaking 8 месяцев назад
Super detailed reply. Appreciate you sharing your perspective! 🙌
@Rai2M
@Rai2M 3 месяца назад
2:42 int player_state = 1 // 2, 3, 100, 102020 no inheritance, just pure states )))
@metaphoricallyspeaking
@metaphoricallyspeaking 3 месяца назад
Sometimes we might not want to merge all logic into a single class and toggle based on the state
@UglyMoneyChannel-pw8hl
@UglyMoneyChannel-pw8hl 2 месяца назад
@@metaphoricallyspeaking so basically separate the states into separate scripts?
@RUEDO123
@RUEDO123 2 месяца назад
I don't like the fact that this video misses the importance of interfaces and polymorphism which are solutions to most of the inheritance problems that the video talks about. I honestly think that if you're going to make any kind of program and you're being smart about you program's architecture, you will inevitable use both.
@metaphoricallyspeaking
@metaphoricallyspeaking 2 месяца назад
That's fair. Polymorphism is certainly important. The video aimed to demonstrate how composition can address specific problems associated with inheritance. Hopefully I didn't imply it's the only necessary paradigm.
@RUEDO123
@RUEDO123 2 месяца назад
@@metaphoricallyspeaking No not at all, the video was great! I just felt like it was a bit unfair for inheritance hahah
@anand_-
@anand_- Месяц назад
​@@RUEDO123 hey do you have any resources on polymorphism and how do use interface ... ?
@RUEDO123
@RUEDO123 Месяц назад
@@anand_- No but it's pretty easy to find them with a google search
@RUEDO123
@RUEDO123 14 дней назад
@@anand_- not at the top of my head, but I'm sure there are videos and tutorials explaining the concepts
Далее
Composition Is Better Than Inheritance in Python
23:29
Просмотров 260 тыс.
#慧慧很努力#家庭搞笑#生活#亲子#记录
00:11
The Flaws of Inheritance
10:01
Просмотров 947 тыс.
When Optimisations Work, But for the Wrong Reasons
22:19
Only Use Inheritance If You Want Both of These
9:10
Просмотров 17 тыс.
The Most Fundamental Concept in Unity
9:50
Просмотров 52 тыс.
I tried using AI. It scared me.
15:49
Просмотров 7 млн
What is the Smallest Possible .EXE?
17:04
Просмотров 401 тыс.
The Value of Source Code
17:46
Просмотров 51 тыс.
#慧慧很努力#家庭搞笑#生活#亲子#记录
00:11