Fantastic video, clearly explains the basics. I have added it to my "Awesome Dependency Injection in Python" page (alongside other resources and many frameworks and libraries in Python).
You have your reasons for thinking you may need shorter videos, but I found this to be a great length. You delivered information with examples that I can use immediately. This was just 'in-depth' enough without getting lost in the weeds. You cleared up my misunderstanding about Service Location; It is not inherently bad, but WHERE you use it matters. I really enjoyed your PyCon Talk and related article 'Subclassing in Python Redux'. Looking forward to more useful content. Thanks Hynek!!
Thank you! I don’t particularly mind making longer videos (they’re still much shorter than my conference talks!), my problem is that I’m kinda punching above my weight here! I shouldn’t need 2 months for 14 minutes of video -but I lack the skills to be faster even at this quality level. Therefore, I should be churning out videos to get practice and find my style. In that sense, I’m both blessed and cursed by an existing audience. :) I’m not producing videos for the void which feels GREAT, but I also hold myself to higher standards than if my videos had like 65 views.
Just stumbled over your channel. Keep up the original style. There is charisma. The charisma of a software craftsman that knows his shit and has passion for it. That's the kind of person I love working with. Liked and subscribed :)
Protocol is soo underrated, I recently rewrote a library first defining all Protocols and then could go on writing implementations, which was so much easier than the other way around
Great video, thanks! The content is great, and even as an experienced programmer it's nice to see someone explain it all clearly. And the quality of the video itself, regardless of content, is really good too. Looking forward to the next one!
The two bags of grass, seventy-five pellets of mescaline, five sheets of high powered blotter acid, a salt shaker half full of cocaine, and a whole galaxy of multi-colored uppers, downers, screamers, laughers... the quart of tequila, the quart of rum, the case of Budweiser, the pint of raw ether and the two dozen amyls had to pay off eventually!
I really appreciate the distinction of the concepts vs tools, as so many folks have been introduced to a concept by using a tool. Since so much of software engineering is discovered through practical use, what other concepts might you explore to decouple from tools?
That's an interesting question! For me DI landed on my plate naturally because I realized how whenever I talked about DI in context of svcs, people talked about DI _frameworks_ to the point that it annoyed me. :) But I'm sure there's more!?
You’d be surprised how pedestrian my own use of attrs is! Sometimes I think I could just use dataclasses but I always run into some last 1% that’s annoying. :) Clean architecture is mostly about DIP, so this video is basically already the core. :D
"An example of Factory, Factory Factory you found under your bed as a kid..." That's a big problems with everything -- having good, concise examples that don't over-complicate everything even further.
Yes, although it's also part of things "finding their place". The original context of DI were ancient Java and .NET and concepts just have to ripe sometimes and be considered in new contexts. Which is what I'm trying to do. :)
The language of choice have pretty significant impact on the concepts you are able to adopt with it without inflicting pain on yourself and others. Adding some magic annotations that do things during runtime is a risky business, because you will never know if your thing works until you run it. Unit tests with mocked dependencies will obviously not prove that your thing is running fine when the real dependencies are assembled. Passing arguments to your functions is fine for 2-3 dependencies, but it will quickly become pain once your application grows. Having DI framework that does compile time checks that it can build your DI tree is a real time saver and creates great confidence and ergonomics for you. Such libraries are quite few for statically typed languages and unfortunately non-existent for dynamically typed languages 😅 (since there are no compile time checks). So far the best example of such DI approach is built in Scala's ZIO library. I can recommend 👍
FWIW, some dynamic languages including Python have static types now and we even got a type-safe DI framework: github.com/Tinche/incant My service-locator that I mention is also type-safe. :)
"... even if you use global variables, like an animal" had me laughing. Who says Germans have no charisma? Oh, wait... Hynek did 😂 Anyway, you got me to subscribe
I love DI, but I've also seen it misused to the point that it made it impossible to follow the code without a debugger. Keep your dependencies as simple as possible, and remember that if your dependencies also have multiple dependencies injected, you will have a very bad time.
Sounds more like a critique of DI frameworks than of DI. ;) One of the upsides of DI as presented is that it ADDS clarity where those dependencies are coming from in the first place.
@The_Hynek it's probably more of a critique of that particular codebase than anything else 😅 Still, when you use DI that gets determined at runtime you lose the ability to cmd+click through the code flow. It is not an issue for things like db connections since you rarely have to walk through functions like .execute(), but it can be an issue if you use DI for the code you are now trying to debug.
Interestingly enough, this is more of an argument against DIP/interfaces than DI. You can totally make your arguments cmd-clickable if you use concrete types. I wonder how much anger against DI is misguided anger against DIP (= general musing, not against you :)).
@@The_Hynek Yeah, I should have been writing DIP instead of DI the whole time! For me personally dependency injection is too much of a fancy word for just passing an object through function arguments. There *has* to be more to it. Definitively some misguided anger there :)
@@The_Hynek Me and my wife is prepping for a baby and we are doing renovation work at place of my mother-in-law. So my room is stuffed extremely dense and I am at maximum blur at all calls. So I am on the same page, haha
I downvote every single video that promotes a VPN service, no matter how good the content is or how much do I like the youtuber. This is one of those rare ocations in which a youtuber talking about VPN services at the end of a video made me to like the video and subscribe to the channel.
he means the incessant mic punching :) Currently, I have the problem that the moment I start moving my arms to be less of a statue, there's an elevated risk of hitting the mic and people think someone is knocking on their door. ;)
Congratulations on starting your own channel. Always love your unconventional style :-)
For anyone not familiar, Hynek has written some incredibly well designed libraries like structlog. I use several of his libraries every day.
thank you for your kind words! 🤭
Fantastic video, clearly explains the basics. I have added it to my "Awesome Dependency Injection in Python" page (alongside other resources and many frameworks and libraries in Python).
Thank you so much! 💜
You have your reasons for thinking you may need shorter videos, but I found this to be a great length. You delivered information with examples that I can use immediately. This was just 'in-depth' enough without getting lost in the weeds. You cleared up my misunderstanding about Service Location; It is not inherently bad, but WHERE you use it matters. I really enjoyed your PyCon Talk and related article 'Subclassing in Python Redux'. Looking forward to more useful content. Thanks Hynek!!
Thank you!
I don’t particularly mind making longer videos (they’re still much shorter than my conference talks!), my problem is that I’m kinda punching above my weight here! I shouldn’t need 2 months for 14 minutes of video -but I lack the skills to be faster even at this quality level.
Therefore, I should be churning out videos to get practice and find my style. In that sense, I’m both blessed and cursed by an existing audience. :) I’m not producing videos for the void which feels GREAT, but I also hold myself to higher standards than if my videos had like 65 views.
Just stumbled over your channel. Keep up the original style. There is charisma. The charisma of a software craftsman that knows his shit and has passion for it. That's the kind of person I love working with. Liked and subscribed :)
Thank you for finding and appreciating my backcatalog! That video specifically is very dear to my heart. :)
Very nice.
Great channel and great content cant wait to see moe!
Protocol is soo underrated, I recently rewrote a library first defining all Protocols and then could go on writing implementations, which was so much easier than the other way around
Keep posting videos! They are great so far!
Great video, thanks!
The content is great, and even as an experienced programmer it's nice to see someone explain it all clearly. And the quality of the video itself, regardless of content, is really good too.
Looking forward to the next one!
Thank you! 💜
3:07 nice reference to fear and loathing in las vegas!
The two bags of grass, seventy-five pellets of mescaline, five sheets of high powered blotter acid, a salt shaker half full of cocaine, and a whole galaxy of multi-colored uppers, downers, screamers, laughers... the quart of tequila, the quart of rum, the case of Budweiser, the pint of raw ether and the two dozen amyls had to pay off eventually!
I really appreciate the distinction of the concepts vs tools, as so many folks have been introduced to a concept by using a tool. Since so much of software engineering is discovered through practical use, what other concepts might you explore to decouple from tools?
That's an interesting question! For me DI landed on my plate naturally because I realized how whenever I talked about DI in context of svcs, people talked about DI _frameworks_ to the point that it annoyed me. :) But I'm sure there's more!?
The feeling of actually learning und understanding something greatly overshadow any mic hits or so, you are an awesome source of knowledge Hynek
You’d be surprised how pedestrian my own use of attrs is! Sometimes I think I could just use dataclasses but I always run into some last 1% that’s annoying. :)
Clean architecture is mostly about DIP, so this video is basically already the core. :D
"An example of Factory, Factory Factory you found under your bed as a kid..." That's a big problems with everything -- having good, concise examples that don't over-complicate everything even further.
Yes, although it's also part of things "finding their place". The original context of DI were ancient Java and .NET and concepts just have to ripe sometimes and be considered in new contexts. Which is what I'm trying to do. :)
The language of choice have pretty significant impact on the concepts you are able to adopt with it without inflicting pain on yourself and others. Adding some magic annotations that do things during runtime is a risky business, because you will never know if your thing works until you run it. Unit tests with mocked dependencies will obviously not prove that your thing is running fine when the real dependencies are assembled. Passing arguments to your functions is fine for 2-3 dependencies, but it will quickly become pain once your application grows.
Having DI framework that does compile time checks that it can build your DI tree is a real time saver and creates great confidence and ergonomics for you. Such libraries are quite few for statically typed languages and unfortunately non-existent for dynamically typed languages 😅 (since there are no compile time checks). So far the best example of such DI approach is built in Scala's ZIO library. I can recommend 👍
FWIW, some dynamic languages including Python have static types now and we even got a type-safe DI framework: github.com/Tinche/incant
My service-locator that I mention is also type-safe. :)
"... even if you use global variables, like an animal" had me laughing. Who says Germans have no charisma? Oh, wait... Hynek did 😂 Anyway, you got me to subscribe
I love DI, but I've also seen it misused to the point that it made it impossible to follow the code without a debugger. Keep your dependencies as simple as possible, and remember that if your dependencies also have multiple dependencies injected, you will have a very bad time.
Sounds more like a critique of DI frameworks than of DI. ;)
One of the upsides of DI as presented is that it ADDS clarity where those dependencies are coming from in the first place.
@The_Hynek it's probably more of a critique of that particular codebase than anything else 😅 Still, when you use DI that gets determined at runtime you lose the ability to cmd+click through the code flow. It is not an issue for things like db connections since you rarely have to walk through functions like .execute(), but it can be an issue if you use DI for the code you are now trying to debug.
Interestingly enough, this is more of an argument against DIP/interfaces than DI. You can totally make your arguments cmd-clickable if you use concrete types.
I wonder how much anger against DI is misguided anger against DIP (= general musing, not against you :)).
@@The_Hynek Yeah, I should have been writing DIP instead of DI the whole time! For me personally dependency injection is too much of a fancy word for just passing an object through function arguments. There *has* to be more to it. Definitively some misguided anger there :)
I would zoom you out a little. We usually have a little wider fov when looking at a person
Great vid btw, I am glad to see your content!
I would too if I had more space. ;) Note how there’s a piece of a door left and a picture top right when max zoomed out :-/
@@The_Hynek
Me and my wife is prepping for a baby and we are doing renovation work at place of my mother-in-law. So my room is stuffed extremely dense and I am at maximum blur at all calls. So I am on the same page, haha
Moin moin aus Hamburg 😁
🐻👋🐟😜
I downvote every single video that promotes a VPN service, no matter how good the content is or how much do I like the youtuber. This is one of those rare ocations in which a youtuber talking about VPN services at the end of a video made me to like the video and subscribe to the channel.
Glad to hear I'm not the only one with that particular pet peeve!
Just hoping the contents is somewhat interesting too tho. 😅🙈
@@The_HynekI have watched 2/3 of your videos and they are the most underrated videos in TH-cam!
Poor mic…
I will need to find a better setup. 😅
@@The_Hynek I've spent a lot of time getting to know mics. My take: your mic is fine.
he means the incessant mic punching :)
Currently, I have the problem that the moment I start moving my arms to be less of a statue, there's an elevated risk of hitting the mic and people think someone is knocking on their door. ;)
@@The_Hynek I am using headphones and the mic is adequate. Don't let it bother you too much.