whm1974 wrote:Well at least I'm learning to avoid writing bad code.
The phrase you might hear about that is "if the program works perfect with perfect input, then you're only half done".
Here's a real world example. At my last job I had a bug to deal with which seemed to be causing confusion between payment processors. At the time there was both paypal and a credit card available for payment methods, and it looked like a few people had managed to find a way to use both paypal and a credit card to place an order. It wasn't split payments where a portion was being placed on each. It was just a weird, bad order that the system choked on, and then caused the customer service folks headaches having to clean it up. It was doubly weird because the paypal entry form wasn't even part of the application its self. That was external, with service calls going back and forth between the two(hint: never really been a fan of paypal since then...). It turned out to be confined to cases where a credit card payment was declined for some reason and the user returned back to the payment page. The problem was that if they then tried to pay through paypal the CC fields were still populated with whatever garbage had been there previously. We cleared the other method any time they switched from one method to the other, and the bug was dead.