by jiggawatts · 2y ago · 0 comments
This is why we can't have nice things, because someone somewhere always wants to cut a corner in a way that isn't as robust as they think it is.
I once had an argument with a junior developer that he can't just use a hash code directly instead of an equality check. It can be used as a first step to quickly reject unequal values, but equality must be verified. He disagreed right up until a finance report had "unexpected" dollar figures in it.
There is nothing I value more in the code I write than 100.0% pedantic correctness.
The opposite of this is inserting Thread.sleep(1000) into multi-threaded code to "fix" it.
It's a tiny, slippery step from skipping a correct parsing step to that eldritch madness.
I've also been a junior developer and thought that my code has to be correct, look correct and perform correctly. Then I got a boss. Boy I was wrong.
How do you think that XML was generated?
By people who took similar shortcuts, that's how.
Layering badness on top of badness results in a tyre fire.
It's setting your sliders. If you have robust and predictable input, you can forego some of the safety checks in favor of performance.
Are you a manager at Boeing, by any chance?
When dealing with messy input data, this goal can be akin to perfect being the enemy of the good.