Should I declare a number as constant if it is passed as a parameter to a meaningful named function?

52 Views Asked by At

Suppose we a validation code similar to the following:

Rule(account => account.CompanyName).MaxLength(50)

Or

Rule(account => account.Balance).MustBeGreaterThan(0)

Do we still call the numbers 50 or 0 a magic number and define a constant for it, although the functions those are passed in have meaningful name which explains what the number is for?

0

There are 0 best solutions below