How to Use C++ Dependency Injection to Write Maintainable Software - Francesco Zoffoli CppCon 2022

  Рет қаралды 27,865

CppCon

CppCon

Күн бұрын

Пікірлер: 21
@babgab
@babgab Жыл бұрын
"You don't need to have everything as classes to use dependency injection" THANK YOU. I wish this were known more widely.
@TheSaucyP
@TheSaucyP Жыл бұрын
The way to explain interactions with geometrical figures is so clear and smart that should be used constantly in lessons, thanks!
@salahsoliman5752
@salahsoliman5752 7 ай бұрын
Writing simple understandable code is much better than trying to achieve perfection. I don’t agree with the philosophy of this talk, but I enjoyed the fancy ideas.
@guilherme6535
@guilherme6535 Жыл бұрын
Very nice talk.
@davidsicilia5316
@davidsicilia5316 Жыл бұрын
great talk
@wolpumba4099
@wolpumba4099 Жыл бұрын
Amazing!
@nintendoeats
@nintendoeats Жыл бұрын
While that was interesting, it also made it clear to me that Francesco Zoffoli deals with a very different set of problems then I do. I can only think of a handful of places where this sort of added scaffolding would apply in my codebase, and those cases are already handled perfectly well by simple base* and runtime polymorphism. In essence, this seems very applicable to the sort of work one might do at Facebook; building behaviours that you expect other people to assemble like lego. I'm not convinced that the complexity overhead would be worthwhile for many smaller scale/less reusable projects (especially in my case where dependency on an external library already creates inherent coupling between many procedures and data structures).
@ChristianBrugger
@ChristianBrugger Жыл бұрын
I am also curious about this. How are these things useful on a smaller scale.
@qazarl
@qazarl Жыл бұрын
shared_ptr has constructor from unique_ptr, there's no point in returning shared_ptr from factory
@oysteinsoreide4323
@oysteinsoreide4323 11 ай бұрын
As long as it is R-Value. Yes. That is correct. But will that make any difference?
@oysteinsoreide4323
@oysteinsoreide4323 11 ай бұрын
I did some experimentation, and yes, a factory that returns a unique_ptr is more versatile if you want to use a unique_ptr on the client side of things. As a unique_ptr - R value can be assigned to a unique_ptr L-value. And a shared_ptr L-value can be assigned from a unique_ptr - R value.
@Nessaes
@Nessaes Жыл бұрын
The factory whose given solution was to use a shared pointer.... it's just bad. The example was clearly bad designed, if the bufffilereader needs a buffer, he basically needs to own it, and hence to take a unique_ptr through a move. If he doesn't then a reference to the unique_ptr is fine (and then someone else has to own it, thus why instanciating in the clojure?). Last but not least, if bufffilereader interface supports legacy code via raw pointers, then a simple release() of the unique_ptr was sufficient.
@niklkelbon3662
@niklkelbon3662 Жыл бұрын
Hm, why no type erasure? Its what you need
@batorygimnazjum2683
@batorygimnazjum2683 Жыл бұрын
Reference member variables are usually a bad idea, I don't understand why the presenter recommends them. They remove default copy and move assignment. Storing raw pointers has identical utility and no such drawbacks.
@scatterarrow
@scatterarrow Жыл бұрын
In my experience, any class that has pointers and references to other complex functional objects (not just data) is not something that should be copied and doesn't need to. And something that holds data should not and really doesn't need any access to (polymorphic) behaviors and has simple constructors. So, removing something you shouldn't have anyway is a good thing. Many programming languages nowadays start out with "data classes" or "record" etc
@privateerburrows
@privateerburrows Жыл бұрын
Utterly inscrutable talk. No concrete example whatsoever; all abstract talk.
@heruilin4404
@heruilin4404 Жыл бұрын
Agreed .. pathetic
@glorioussir9673
@glorioussir9673 Жыл бұрын
Title should be like "How to speed down compile time 100x"
@6eeykwr2
@6eeykwr2 Жыл бұрын
Man the constant clicking noises he makes with his mouth is so annoying
Dependency Injection | Prime Reacts
28:34
ThePrimeTime
Рет қаралды 355 М.
Муж внезапно вернулся домой @Oscar_elteacher
00:43
История одного вокалиста
Рет қаралды 7 МЛН
Симбу закрыли дома?! 🔒 #симба #симбочка #арти
00:41
Симбочка Пимпочка
Рет қаралды 5 МЛН
Accompanying my daughter to practice dance is so annoying #funny #cute#comedy
00:17
Funny daughter's daily life
Рет қаралды 24 МЛН
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 887 М.
Why Didn't He Get the Job? Let's Find Out! // Code Review
27:25
The Cherno
Рет қаралды 151 М.
Branchless Programming in C++ - Fedor Pikus - CppCon 2021
1:03:57
How to Do Code Reviews Like a Human
22:49
PyGotham 2018
Рет қаралды 43 М.