Function Parameter Constraint
As a developer every day I find myself in situations where I have to write different methods for purposes of any kind. Generally, I write methods that take into one or more input parameters and return a particular result
Problems arise when my colleagues use the methods that I write. In particular, the biggest problems occur when they are specified in input values that are not valid for the execution of method.
Ok. I know that I can test each parameter before the execution of the real first instruction but it's a very frustration for a developer like me.
I think that can be nicely to have a mode for define at syntax level a constraint for a parameter of a method.
Something like :
<BetweenContraint(i,0,100)> _
Public Function TakeIntegerBetween0And100(ByVal i As Integer)
There is already something like this or I invented the wheel?
I know only looking for on Google or with a comment of some blog reader.