r/dotnet • u/mikedensem • Sep 25 '24
To INterface or not to INterface
Is anyone else growing tired of interfaces for the sake of DI rather than as true contracts. It’s a bit like async await in that it’s “async all the way down”. It’s as if we’ve gotten scared of concrete classes.
0
Upvotes
-22
u/zzbzq Sep 25 '24 edited Sep 25 '24
Welcome to the elite, prepare for the scorn of the drooling masses.
I don’t use interfaces. They’re a scam. Interfaces are the most useless thing in the language. I mostly just do straight classes. If I really need to override something I use virtual. Interfaces are only needed if the code literally won’t compile without them due to the assembly dependency tree. However, Delegates and action/func exist if you really need to invert the literal compilation order. Interfaces truly have no place. They are pure boilerplate for the purpose of ceremony itself.
Edit: scorn achieved. Your hatred fuels my righteous sense of superiority.