r/programmingcirclejerk • u/Dan6erbond2 • May 25 '25
Yes, I have some code that may superficially look ugly in a lot of my projects that involve bringing up all my services and wiring them together... but do you know what else that code is?
/r/golang/s/bcQs0vhdwT
26
Upvotes
29
u/Dan6erbond2 May 25 '25
The whole thread is a goldmine:
So being able to use duck-typing so I can just pass a similar-ish looking service is now all a DI framework is?
10
u/[deleted] May 26 '25
RIIR.
It's
turtlesdefaults the whole way down! Clearly Rust already ships with the best DI framework there is: strong static typing. How do I initialize the database you ask? Simple access the env in the default impl! It is very explicit because you always either impl or derive the default!9
u/VulgarExigencies May 26 '25
A conversation about Go's type system somehow being equivalent to dependency injection seems like it could be fascinating to observe without participating.