3 ms·
Though to be fair it's not obvious where to encode validation. You're saying it should be intrinsic in the parsing rules of ipv4. But there are reasons why you
by wild_preference 8y ago
Though to be fair it's not obvious where to encode validation. You're saying it should be intrinsic in the parsing rules of ipv4. But there are reasons why you would want to validate in a separate pass.
For example, the more errors you parse, then the better error messages and introspection you have (structured data) when you want to validate.
It's a classic trade-off.
You're right though, doesn't make a very good example.