2 ms·
If it even can be tested. I’ve spent decades now dealing with beginning Java programmer’s preference for the relative simplicity of static initializers; that i
by commandlinefan 7y ago
If it even can be tested. I’ve spent decades now dealing with beginning Java programmer’s preference for the relative simplicity of static initializers; that is, code that starts trying to connect to a live database as soon as you run it in a way that can’t be mocked out without making dangerous changes to the code in the first place.
- nitrogen 7y agoThere are improved mocking libraries these days with much more power, so the everything-must-be-an-interface pattern is no longer required most of the time. If writing testable code means writing obfuscated code, it's a good sign that the language ecosystem needs to improve, and for Java, it has.