2 ms·
> I'm strongly against creating interfaces for non-library (not shared) code, that will only ever have one concrete implementation. Even if it does, for a mild
by octorian 7y ago
> I'm strongly against creating interfaces for non-library (not shared) code, that will only ever have one concrete implementation.
Even if it does, for a mild behavior change or a test implementation, the simple fact that Java methods are virtual-by-default is a huge benefit here.
C#, on the other hand, is final-by-default. This makes code much more annoying to deal with unless it implements an interface and/or is thoughtfully written with these cases in mind.