3 ms·
I never understand why people criticize using interfaces for most functionality. How else do you write effective unit tests? Interfaces with dependency inject
by jugg1es 5y ago
I never understand why people criticize using interfaces for most functionality. How else do you write effective unit tests? Interfaces with dependency injection make unit tests far easier to write. Smartly designed interfaces also make code easier to read and understand. Lastly, adding new interfaces is trivially easy, so why not?
- Jensson 5y agoYeah. Similarly, walls of text are bad. I use line breaks after every sentence to fix that. I see no reason why not. This way you can clearly tell apart sentences. Adding new lines doesn't require any more time than just writing a space. So why not just do it always? By following this rule I never wrote a wall of text again!
- wheelerof4te 5y agoWhat is an Interface? What is a dependency injection? How can you explain them to someone who never needed to use them? Do I need unit tests when my code is dead simple, or written in Rust? Etc...