2 ms·
Composition (Interfaces) / Dependency injection / mocking. Each one is invaluable on their own, but combined they make for very clean, maintainable, and easily
by lloydjatkinson 9y ago
Composition (Interfaces) / Dependency injection / mocking.
Each one is invaluable on their own, but combined they make for very clean, maintainable, and easily testable software.
I find it hard to take any modern language that isn't capable of these seriously. For example, Rust (from talking to some Rust devs on /r/rust) does not have interfaces only "traits" and this prevents you from from being able to use DI thus limiting your ability to mock in the process.
And by dependency injection, I don't mean the XML bullshit that I see Java developers complaining about a lot.