| ▲ | what 6 hours ago | |||||||||||||||||||||||||||||||||||||||||||
>encoding that a number is between 2 and 200 What’s the point of this level of autism when you still have to add run time checks? | ||||||||||||||||||||||||||||||||||||||||||||
| ▲ | kennywinker 5 hours ago | parent [-] | |||||||||||||||||||||||||||||||||||||||||||
For a function setVelocity() that can accept 1..<200. You call it with numbers that you enter directly and types tell you something that would otherwise be a comment on the function, or you do runtime checks elsewhere, and the type becomes proof that you checked them before handing it into the function. Btw, using “autism” to mean “pedantry” leaves a bit of a bad taste in my mouth. Maybe you could reconsider using it that way in the future. | ||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||