3 ms·
Another consideration: We've all probably read that “Programs must be written for people to read, and only incidentally for machines to execute.” When another
by scott-smith_us 7y ago
Another consideration:
We've all probably read that “Programs must be written for people to read, and only incidentally for machines to execute.”
When another (maintenance) developer sees float/double being used to represent money, their first reaction is going to be "uh oh, this dev didn't know what s/he was doing". There's a big risk of someone reflexively refactoring this later on.
You may ask, "What if I put in big comment blocks saying essentially 'I knew what I was doing here'?"
Well, even if maintenance devs read that and believe you, they're still likely to introduce errors, since they aren't used to using floats for money, and don't know all the tricks to avoid errors...
Unless there's some justifiable win in size / performance, this (although interesting) falls under my "Don't be too clever" rule.