3 ms·
To me the article was more about the anti-pattern of having self-validating objects than trying to show where it can end badly. I now use only plain data (scal
by jeremiep 11y ago
To me the article was more about the anti-pattern of having self-validating objects than trying to show where it can end badly.
I now use only plain data (scalars, sequences and mappings) to represent data. The validation can be implemented independently and I can reuse all of the language's data manipulation functions. Its really the best of both worlds.
As Rich Hickey said in "Simple Made Easy", the only thing you can do with data is destroy it by encapsulating it.