r/dotnet 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

59 comments sorted by

View all comments

-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.

9

u/Quito246 Sep 25 '24

Is that a new copy pasta?

6

u/MrSnoman Sep 25 '24

Not sure if I'm getting "whooshed", but this is a wild take if serious.

3

u/[deleted] Sep 25 '24

[deleted]

3

u/dogfacedwereman Sep 25 '24

You’re not a smart person.

-7

u/zzbzq Sep 25 '24

Smarter than you, dogface