Hacker News new | ask | show | jobs
by snidane 1451 days ago
> Why would I write a separate schema when the object itself knows what it will accept, what is optional, and what range the values should be in?

Because data is just data and the meaning to it is given at the time of application. If you want to couple validation to the data itself - how do you decide which N of the meanings to validate against?

1 comments

No, data must have meaning, else it is meaningless.

If you want to process the data you must use some language to access parts of the data. Data must have a symbolic representation, not juts be 1s and zeros. Or it can be a bit-stream, but even then you need a language that knows the different between 1 and 0.

person.name

extracts the field 'name' from the data. To manipulate the data, the program must know that there is such a field as 'name' it can ask for.