Imagine you live on a space station and a small meteorite has punctured the shell. There is probably a right way to fix it and, ultimately, you'll want to apply that fix.
Right now, as a friend of mine once characterized it, space is getting in.
Further imagine that the same meteorite has knocked loose the space toilet and you have two choices:
- Grab the toilet and hurl it toward the hole in the wall, using it as a plug and spreading excrement everywhere.
- Die.
Ordinarily, "throw a toilet and distribute feces throughout the space station" is not an answer you would expect to give to any particular question. However, it's probably better than being blown out into an icy vacuum and asphyxiating.
This same concept applies to code. Statistically, there's no surer, faster path to "done" for any slice of scope than to approach it with the utmost professionalism. Yet, sometimes, you need to throw a Hail Mary just for a shot at staying alive.
It's okay to make a mess when you really have no alternative. That said, it's pretty important to make sure you don't cover you and your workplace in crap unless you absolutely, positively must.
...and make sure you clean up after yourself when you do.