Mixins Explained in 3 Minutes (NOT The Same as Multiple Inheritance)

  Рет қаралды 2,119

The Coding Gopher

The Coding Gopher

Күн бұрын

Пікірлер: 27
@TheCodingGopher
@TheCodingGopher Күн бұрын
Thoughts on the new editing style?
@debbie8062
@debbie8062 Күн бұрын
i’m a fan of it 🙂‍↕️
@patrickdecabooter411
@patrickdecabooter411 Күн бұрын
I prefer the old style
@joostvisser6508
@joostvisser6508 19 сағат бұрын
The fade-in on the subtitles is quite distracting, I'd prefer them to just cut from one line to the next. Otherwise I like it!
@yarden-zamir
@yarden-zamir 19 сағат бұрын
Hate the fade in on the subtitles. Means I can't immediately read it
@bee_irl
@bee_irl 16 сағат бұрын
not a fan of these brainrot tiktok-style captions
@sebastianmoser9652
@sebastianmoser9652 Күн бұрын
Thank you, very clear and simple explanation. Mixins look very similar to what PHP calls Traits.
@TheCodingGopher
@TheCodingGopher Күн бұрын
My pleasure
@patrickdecabooter411
@patrickdecabooter411 Күн бұрын
I always love your content, keep it up!
@TheCodingGopher
@TheCodingGopher Күн бұрын
Cheers!
@splytrz
@splytrz 18 сағат бұрын
I'm still not convinced that mixin is distinct from inheritance. It's just a pattern that uses (multiple) inheritance.
@splytrz
@splytrz 17 сағат бұрын
To clarify, I don't have an issue with the video. Maybe with the title though. I'm coming from Dart, where mixins have special syntax, which has made me confused for a long time because I couldn't see how they're different, and the video title has made me hope I'll finally understand it. But nope! Especially seeing you use inheritance to implement a mixin convinced me more that the Dart team has added them as a hack to enable multiple inheritance.
@splytrz
@splytrz 17 сағат бұрын
I think the core of my misunderstanding was that I was thinking about a **different category**. There is no difference between mixins and multiple inheritance **as a language mechanism**, but, **as patterns** they are different. So, while everyone was talking about a design pattern, I was thinking about the language mechanism. (This is reasonable though, because it was prompted by the language design that presented them as a separate mechanism)
@nathaaaaaa
@nathaaaaaa Күн бұрын
Mixins are the foundations of modern Minecraft modding, but we just see it as bytecode modification framework.
@thefanboy3285
@thefanboy3285 11 сағат бұрын
:o
@anon_y_mousse
@anon_y_mousse Күн бұрын
I suppose it's kind of like Rust's traits. Maybe you could compare and contrast different languages and how they use the concept.
@TheCodingGopher
@TheCodingGopher Күн бұрын
Yes, these are very similar. Though traits in Rust achieve the shared behavior without inheritance. That's a solid idea for a future video
@debbie8062
@debbie8062 Күн бұрын
missed you Gopher! Sad to see no daily uploads but i hope that means ur enjoying the holidays!! i really enjoy this type of video, can’t wait to see what type of content you’ll make this coming year
@TheCodingGopher
@TheCodingGopher Күн бұрын
🚀🚀!
@vvhat
@vvhat Күн бұрын
Its the cpp equivalent of interfaces
@TheCodingGopher
@TheCodingGopher Күн бұрын
Similar, but not exactly. Mixins in Python are more like reusable code snippets added via inheritance, while C++ interfaces (i.e. pure virtual classes) define a contract that classes must implement. Mixins add behavior; interfaces enforce structure.
@davidrieger3160
@davidrieger3160 10 сағат бұрын
Any reason to use this over composition (e.g. make the logger class a field rather than inheriting from it)?
@arijitgogoi5653
@arijitgogoi5653 Күн бұрын
All right let's mixin
@TheCodingGopher
@TheCodingGopher Күн бұрын
Let's go mixin
@lepch
@lepch Күн бұрын
so mixins are just pytest fixtures
@TheCodingGopher
@TheCodingGopher Күн бұрын
Not quite. Mixins are a way to add reusable behavior to classes through inheritance in OOP, while pytest fixtures are specifically designed for setting up / tearing down test preconditions in pytest. Fixtures are automatically injected into test functions (which is the core part of the pytest framework), whereas mixins are a more general programming construct used for sharing code across classes. They can overlap in functionality in some cases - but they're fundamentally different.
How Senior Programmers ACTUALLY Write Code
13:37
Thriving Technologist
Рет қаралды 1,6 МЛН
The Return of Procedural Programming - Richard Feldman
52:53
ChariotSolutions
Рет қаралды 52 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
I Took a Basic Todo App and Made It Cost $2000/Month
10:55
Coding with Lewis
Рет қаралды 75 М.
Python laid waste to my C++!
17:18
Sheafification of G
Рет қаралды 157 М.
Why OOP is evolving(and why it's a good thing)
7:35
TMF
Рет қаралды 13 М.
8 Rules For Learning to Code in 2025...and should you?
12:59
Travis Media
Рет қаралды 79 М.
Clean Code is SLOW But REQUIRED? | Prime Reacts
28:22
ThePrimeTime
Рет қаралды 330 М.
Coding Was HARD Until I Learned These 5 Things...
8:34
Elsa Scola
Рет қаралды 818 М.
A New Era for C and C++? Goodbye, Rust?
9:08
Travis Media
Рет қаралды 119 М.
A Number to the Power of a Matrix - Numberphile
16:45
Numberphile
Рет қаралды 167 М.
How LLVM is Revolutionizing Code Generation
7:16
The Coding Gopher
Рет қаралды 7 М.
The Rust Survival Guide
12:34
Let's Get Rusty
Рет қаралды 170 М.
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН