4 ms·
> Classes are overrated. If you work from a more functional over oo mindset, you'll find that you really don't need them. I do work in a functional mindset. I
by lmm 12y ago
> Classes are overrated. If you work from a more functional over oo mindset, you'll find that you really don't need them.
I do work in a functional mindset. I still find that I need them often, for cases where one case needs to be handled differently from others, which is a very common business requirement. Something like typeclass deriving can help, but javascript doesn't have that.
> doing unit testing in JS doesn't require the mental spaghetti of interfaces or IoC/DI that it does in strongly typed languages.
You don't have to do it that way if you don't want to - even in humble java it's trivial to mock any object or none if that's what you want. I like having explicit interfaces - they're what make it possible to maintain big codebases.