If a single developer was able to cause a 'nasty' anything, your engineering process is completely wrong.
It should have been caught at architectural discussions.
It should have been caught during performance benchmarking.
It should have been caught at code review.
Didn't do any of those things? Don't blame the developer. No single individual encompasses all knowledge required to adequately address all of your tasks. Someone with the foundations you want could just as easily have fucked up something else.
The retort to this is usually along the lines of “we are moving fast and need people to write 100% correct code”. Perhaps that’s the case, but the solution is to put guidelines down (api review, unit testing, etc) instead of demanding people be infallible.
In this case a reasonable test case beyond “Did it compile?!?” Would have caught this.
In this case the two points where we should have caught the issue would have been:
* Integration testing with a specific data set that was different from actual production data.
* Code review (they're not systematic yet but we're working on that) because the faulty code had a sketchy section and the conversation around it would have lead to a better version (that's what actually happened when fixing the bug)
My intent was not to blame the developer, I'm aware of the context they work in and as you have guessed correctly our engineering process is fucked up in many way.
The developer writing the correct implementation was just the earliest point where it could have been avoided in this case, I didn't want to frame it as the developer's fault, but simply wanted to say that some algorithmic knowledge still comes in handy.
My original comment wasn't clear enough about this I confess.
It should have been caught at architectural discussions.
It should have been caught during performance benchmarking.
It should have been caught at code review.
Didn't do any of those things? Don't blame the developer. No single individual encompasses all knowledge required to adequately address all of your tasks. Someone with the foundations you want could just as easily have fucked up something else.