After writing my 10,000th check to ensure a decimal argument is greater than or equal to zero, I wondered:
Wouldn’t it be easier to create a custom decimal struct that enforces this rule, much like uint
?
After looking at the Decimal.cs
source, I’m having second guesses.
There’s a lot going on in there, and it’s not hard to imagine baking this into an application – and then finding some critical problem.
Are there any libraries out there that have already done this?
Or, are there reasons this is a terrible idea?
Thanks!