I've seen a lot of ugliness in code. Most of the time, it just doesn't matter if it works as expected. The ones that bother me are the cases where the coder assumes what the user is going to do, assumes that it will be what he/she expects, and has nothing to handle silly, stupid, malicious, unpredictable input from the user. These situations are totally undefined, and anything can happen. Always error-check user input and data before using it!
I work in business software, it's not terribly different.
I've seen a lot of ugliness in code. Most of the time, it just doesn't matter if it works as expected. The ones that bother me are the cases where the coder assumes what the user is going to do, assumes that it will be what he/she expects, and has nothing to handle silly, stupid, malicious, unpredictable input from the user. These situations are totally undefined, and anything can happen. Always error-check user input and data before using it!