3 ms·
> Every layer of indirection needs to earn its keep. So much this. One of the things I absolutely hate seeing are the use of interfaces with a single concrete
by PH95VuimJjqBqy 3y ago
> Every layer of indirection needs to earn its keep.
So much this. One of the things I absolutely hate seeing are the use of interfaces with a single concrete implementation.
context matters, it makes sense if you're authoring a library, it can make sense if you're working in something overly dynamic such as Ruby, Python, et al, but in a language like C#, Java, C++, et al, the compiler will assist you if you ever find yourself needing a second concrete implementation and most likely if you DO end up needing that second implementation, the interface is going to change anyway.