this post was submitted on 08 Jul 2023
576 points (97.2% liked)

Programmer Humor

19607 readers
687 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] -1 points 1 year ago (12 children)

Thanks for the write up, but as I said, I know and I've read all about that already. I still cannot see, why a simple function argument and an interface isn't enough (you can probably already call that "dependency injection" if you want to get fancy)

I guess I have just divorced with OOP and the "necessary" "design patterns"...

Things are more simple and less boilerplaty now for me :).

[–] [email protected] 12 points 1 year ago (9 children)

My brother in Christ, that is dependency injection. Just because you don't want to call the spade a spade anymore doesn't make it not so.

[–] philm 0 points 1 year ago (8 children)

Yeah I guess you can call it like that, I'll just call it function invocation...

[–] jvisick 3 points 1 year ago

“Dependency injection” is just a term for providing a function or method with its dependencies rather than making the function go and gather them itself.

It’s (typically) done through parameters, but it’s still more specific than just invoking a function. It describes how that function was written and the reasoning for certain parameters. To the other commenter’s point, you’ll have a hard time communicating about your code with other developers if you refuse to use the term dependency injection just because you don’t like OOP.

load more comments (7 replies)
load more comments (7 replies)
load more comments (9 replies)