Twenty five thousand dollars of funny money

I used to work at a place that sold ads. One of the things this company wanted was for the employees to try it out and see what it was like to actually use the ads product themselves. It's the usual "dogfooding" thing you hear about sometimes.

Click to view the original at

Hasnain says:

Pour one out for PHP. Just kidding - this bug would happen in most codebases out there unless specific precautions were taken.

"I had been at the company something like six weeks and had changed a line of source code to fix a bug (logging), to uncover another bug (wrong argument count), to enable yet another bug (wrong units, and zero type safety) that gave 25 grand worth of funny money to anyone who clicked! And I had clicked! And I got a friend to click! And other people got it too!

What happened? They just turned off the feature until they could fix it. Those of us who had way too much credit in our accounts turned off our ads so as not to actually consume any of the "bad money", and kept them off until they reversed it out of our accounts. Then we were clear to go back to dogfooding.

And no, nobody was fired for this.

This is yet another reason why I say bare numbers can be poison in a sufficiently complicated system. If that function had demanded a type called "dollars" and the caller had another one called "pennies", it simply would not have passed the type checker/compiler. But, this was before those days, so it sailed right through."

Posted on 2022-12-05T22:01:51+0000