Quiz time: What does this mean?
If you think it means you can’t spend anything, you’d be right.
Just kidding, it means you can spend everything.
If I gave this card out, someone could spend all of my money.
Violates unix’s law of least surprise.
Violates convention of 0 never being infinity.
Violates a natural way of giving out a degenerate card (it can be useful)
How to fix it?
1 - In old school C where we rarely used union types and always wanted ints to be ints, we’d use -1 for infinity.
2 - Use a string, “UNLIMITED” that makes it VERY clear what’s going on. Unlike 0.
So, don’t be lithic. Don’t use 0 for infinity, or your customers could go broke.
I agree with your main point; I would be frustrated as well.
But one phrase you wrote really feels wrong. UNIX means something very specific https://www.opengroup.org/unix-systems
There is no UNIX law of least surprise. I believe "Principle of Least Astonishment" was coined by Ward Cunningham.
There is no "UNIX law", only UNIX philosophy.
Maybe you are trying to paraphrase Eric S. Raymond? But that's not exactly what he said either