Comment by bsaul

4 years ago

seems that most comments here missed the end of the article , where he points to the "production ready" version of the solution, that is indeed very close to the original one, including a while loop.

> ..."production ready" version of the solution, that is indeed very close to the original one, including a while loop.

What's missing still is a comprehensive set of test cases to check against.

If such cases were spec'ed to go along with the original code, fthen at least one could have seen the applicability range and perhaps other people would have added some challenging corner cases (just as mentioned in the OP).

It's especially ironic given that this is about a StackOverflow code snippet that many people probably also copied without reading.

Neither is production ready because they have no code comments. And if ever there was code requiring comments, this is it.