Scale Forem

Scale YouTube
Scale YouTube

Posted on

CodeOpinion: You Don’t Need an Interface for Everything

You Don’t Need an Interface for Everything

You’ve seen it a million times in .NET: IOrderService, IEmailService, IPaymentService—and only one implementation behind each. That extra layer usually just adds boilerplate without benefit. Interfaces really pay off when you need to swap implementations, mock dependencies for tests, or build a plugin system; otherwise, stick with concrete types or simple delegates and keep things clean.

This widespread overuse stems from how Dependency Injection is taught. By understanding when to use delegates, overrides or comments (and when not to), you’ll avoid needless abstractions and maintain a leaner, more readable codebase.

Watch on YouTube

Top comments (0)