Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
randomdata
· 2y ago · 0 comments
You could prevent arbitrary mutation, pushing computation onto a more flexible type and allowing assignment back to the more constrained type only when first guarded by an appropriate conditional. The whole "parse, don't validate" thing.
Comments
[–]
oasisaimlessly
2y ago
The reference (an excellent read!): "Parse, don't validate"
https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-va...