sopuli.xyz

pkill , to Programmer Humor in STOP DOING DEPENDENCY INJECTION
deadbeef79000 ,

It came over the wire as text! How did you turn it into that?

Gold.

tatterdemalion , to Programmer Humor in STOP DOING DEPENDENCY INJECTION
@tatterdemalion@programming.dev avatar

Say what you want about DI frameworks, but if I have to remove another fucking global variable so I can write a test, I'm going to cut a bitch.

cadekat ,

Dependency injection is so much worse. Oh, hey, where'd this value come from? Giant blob of opaque reflection code.

Zagorath ,
@Zagorath@aussie.zone avatar

It can be used in bad ways, but if it's used in the right way you should never have the situation you just described.

grrgyle ,
@grrgyle@slrpnk.net avatar

Same could be said of a global. There's a time and a place for each.

One thing I'll say is I don't remember us needing a team of senior+ devs to handle web app back in the day...

cadekat ,

I'm not exactly sure what you mean. Doesn't all dependency injection work the way I described?

Without being familiar with the framework, you can't trace your way from the class getting injected into to the configuration, even if you're experienced with the language.

Zagorath ,
@Zagorath@aussie.zone avatar

I don't think so. When I've seen it done it's usually not been random values injected (except when those values are secret keys which should absolutely not be stored in code to begin with), it's usually injecting a service. Another class, usually with a name that makes it easy to trace down. Like if you're building an OrderService, that might take as a dependency an IProductService, which would have injected into it the class ProductService (personally, I don't like the Hungarian notation that C# uses, but it's a convention and my preference for sticking to strong conventions for the sake of consistency outweighs my distaste for Hungarian notation). That's easy to find, and in fact your IDE can probably take you straight to it from the OrderService's constructor.

cadekat ,

I'm using value in the loosest sense, like how all objects are values.

So now if you have three implementations of IProductService, how do you know which one is configured?

Zagorath ,
@Zagorath@aussie.zone avatar

It's easy to imagine a hypothetical way that could lead to problems. But in all the code I've worked with, either that scenario is avoided entirely, or other context makes it absolutely clear which IProductService is being used.

Skullgrid , to 196 in Neurax rule
@Skullgrid@lemmy.world avatar

mySourceOfSuffering.irl

ulkesh , to Programmer Humor in STOP DOING DEPENDENCY INJECTION
@ulkesh@beehaw.org avatar

…and the wheel turns again…

deadbeef79000 , to Programmer Humor in STOP DOING DEPENDENCY INJECTION

Urgh. I just sicked in my mouth.

Die in a hole DI frameworks.

I already have an injection 'framework' it's called a constructor. I already have a factory it's called new

koncertejo , to Programmer Humor in STOP DOING DEPENDENCY INJECTION

As an audio engineer, I was very confused about what this had to do with Direct Injection for a second.

WerDei , to 196 in serverless rule storage
@WerDei@lemmy.blahaj.zone avatar

Not if you're playing in multiplayer

zea_64 ,

Yeah, how am I supposed to publicly leak my S3 bucket now?

Zachariah , to Streetwear in Science that Replicates
@Zachariah@lemmy.world avatar

:o

mvirts , to Streetwear in Science that Replicates

Get one of those battery operated misting fans to go with it

Lmaydev , to Programmer Humor in STOP DOING DEPENDENCY INJECTION

I love dependency injection personally.

I managed to completely change how YARP routed requests by registering a single interface.

The flexibility it provides is awesome. And it makes testing so much easier.

ScruffyDucky , to Streetwear in Science that Replicates

...and sometimes decimates

grrgyle , to Programmer Humor in STOP DOING DEPENDENCY INJECTION
@grrgyle@slrpnk.net avatar

DI: ☺️

DI frameworks: 😒

deadbeef79000 ,

I just DI all the time, it's called a constructor.

TimeNaan , to 196 in serverless rule storage

What's this? Is it a normal chest in MineCraft? Ive only played Minetest so I don't know.

partmussels ,

It's an ender chest. It functions like a chest, but the contents are always the same for every chest. So you could for example fill it with stuff in one place, and access the same stuff from another chest at another place

TimeNaan ,

Oh, I get it now. Thanks!

AVincentInSpace , to 196 in How To Prevent A Rule
TheCoolerMia , to 196 in How To Prevent A Rule
@TheCoolerMia@lemmy.blahaj.zone avatar

rest of the guide
https://lemmy.blahaj.zone/pictrs/image/dce555c6-e68d-4855-afde-eded87595150.jpeg

alternatively, become a slime and join them :3

  • All
  • Subscribed
  • Moderated
  • Favorites
  • kbinchat
  • All magazines