It really depends on the situations and the stakes involved. Id the project is late, most of the time clients dont give a hoot about how well document the code is if their "paid for" requirements are not done. Most of the time its best to have it working in the best you possibly can and have regular code reviews. that way you dont have angry clients and also you have clean code.