2 ms·
"Premature optimization" has become something of an anathema in the coding world, why isn't "premature testing" so scrutinized? Back in the 90's everything was
by daxfohl 13y ago
"Premature optimization" has become something of an anathema in the coding world, why isn't "premature testing" so scrutinized? Back in the 90's everything was over-optimized because, well, it made for more interesting work than coding to requirements and it showed off how smart you were. It seems like unit testing is now the "interesting" thing to show off your intelligence—"how can I abstract this function to allow me to inject a mock that asynchronously...?"
And the sublime thing is that unit test will always be there to show off the original writer's intelligence, just like the crazy cool optimization in the 90's. And while it works perfectly with the developer's idea of how things should work, there's a disparity between that and the real world, and as soon as that disparity is revealed, it's suddenly a lot more work to wade through all the cruft than it would have been if the requirement had just been implemented in the most straightforward fashion.
A few years from now "premature testing" will be a thing.
- daxfohl 13y agoMakes a lot of sense really, and the parallels are there: "First, design without (optimization/testability) in the most straightforward fashion such that it works and the code can be reviewed in a straightforward manner. Only then, decide if some increased (optimization/testability) is worth the extra complexity and implement as necessary." Pragmatic not dogmatic.