Don't abuse 0
Recently I was working with an API that issues credit cards. The killer feature is that you can set a lifetime spend limit. That is when they try to spend more than spend_limit over their whole lifetime, it rejects the auth.
You have no idea how rare this is.
One neat thing you can do is set a spend limit of 0. That’s cool, it makes it easier to make a card with $0 on it, instead of checking if 0, don’t make the card.
Except it doesn’t.
A spend limit of 0, didn’t mean 0. It means INFINITY. As in, you can spend infinite money and nothing will stop you (except daily/monthly limits).
That’s abusing 0. A casual reader/coder will think 0 means 0 because 0 has a natural, conventional meaning. They’ll set the spend limit to 0, and then their customers will spend infinite money and their company goes bankrupt.
If you want to implement infinity, which isn’t a bad idea,…