3 ms·
On your point about compiler enforcing legitimate values, the way I see it is that if u don't get the right values from the outside world you should immediately
by aszen 6y ago
On your point about compiler enforcing legitimate values, the way I see it is that if u don't get the right values from the outside world you should immediately exit the program with a nice error message.
As the data moves further down into your core functions it should become more well defined and highly structured.
Basically you should parse messy data into the types you need and then you don't need to validate the data in each of your functions.
How to enforce this is a tricky problem for the compiler, maybe it's architectural pattern that can be enforced by libraries and frameworks.