I am currently working in a environment, i.e. computational neuroscience lab, where getting results quickly is the most important thing and nobody really cares about the aesthetics of the code, heck not even about the resulting program (the "product") created by that programming. We therefore do indeed often write "ugly" and somewhat unclean code.
I can assure you that I have been angry about (my own and others) working but ugly code more often than not, because at some point you lose control and then you don't even understand what is going on anymore. Try making another 'quick' modification to the source base then. Oh and don't forget the fun to read some other PhD student's (scientific quick hack) code, who isn't even in the lab anymore.