3 ms·
Agreed, and in my primary language, C#, these days I would rather just write static classes with static methods and pass in other static methods instead of mess
by mortyseinfeld 13y ago
Agreed, and in my primary language, C#, these days I would rather just write static classes with static methods and pass in other static methods instead of messing around with interfaces all the time. I write ASP.NET MVC so I don't use state for the most part.
Ok, so I don't do that with controllers for obvious reasons, but my business logic and utilities I try to.
- V-2 13y ago"I write ASP.NET MVC so I don't use state for the most part." Nor unit tests I assume
- mortyseinfeld 13y agoCare to explain?
- V-2 13y agoThe use of statics makes mocking and testing very difficult. A few thoughts on the subject: http://misko.hevery.com/2008/12/15/static-methods-are-death-to-testability/ http://misko.hevery.com/2008/12/15/static-methods-are-death-... If you use static classes for business logic, you typically end up with a tightly coupled system in which managing class dependencies is a pain. I think that "messing around with interfaces all the time" is worth the fuss in the long run.