3 ms·
Yeah, I have also found that even very good OOP programmers will take longer to implement their designs, and they are no less error-prone. Unit testing seems mu
by ErikAugust 7y ago
Yeah, I have also found that even very good OOP programmers will take longer to implement their designs, and they are no less error-prone. Unit testing seems much trickier as well.
- gmueckl 7y agoIf unit testing is added to an OO language in such a way that it alllows you to ignore access qualifiers completely in unit tests (and only there), the whole process becomes a lot less painful. I am not a programming language expert, but I think that enkisting the help of the compiler for stubbing and mocking could potentially ease a lot of pain.
- DaiPlusPlus 7y agoC# has `InternalsVisibleTo` FWIW - though `internal` isn’t the same as `private` - but if you really want to unit-test private members you can always use reflection. An OOP purist would tell you to abstract-out your fancy private logic into a DI-injected service that can then be tested separately.
- gmueckl 7y ago> An OOP purist would tell you to abstract-out your fancy private logic into a DI-injected service that can then be tested separately. Many OOP purists don't seem to think about ways the language itself could work differently to support them better. All these guys seem to remember is their set of favorite hammers.
- DaiPlusPlus 7y agoWell, consider composition-over-inheritance, traits and mixins - all of which require language support, otherwise you get horrible developer ergonomics issues like having to repeat interface implementations over and over - or build your own domain-level implementation of traits - which just wastes people’s time.