An interesting exercise would be to actually maintain both versions: e.g. make utf-8 friendly; add error handling.
I think McIlroy's version would still come out on top but not by as much.
Nice, informative error handling is one of the things most lacking in shell scripts.