Scale Forem

Scale YouTube
Scale YouTube

Posted on

CodeOpinion: You Don’t Need an Interface for Everything

TL;DR

You Don’t Need an Interface for Everything calls out the habit of creating IOrderService, IEmailService, IPaymentService, etc., when there’s only ever one implementation. Interfaces only add real value if you actually need to swap implementations, mock for tests, or enforce clear boundaries—otherwise they just clutter your codebase.

This pattern largely stems from how Dependency Injection is taught in .NET, but you can often get away with delegates, abstract classes, or plain classes until you really need that extra layer of abstraction. Keep it simple and add interfaces when they earn their keep.

Watch on YouTube

Top comments (0)