Hacker News new | ask | show | jobs
by angra_mainyu 856 days ago
The pattern sounds nice in theory, but very cumbersome since now you have to obsessively ensure you have NewX calls everywhere or some form of "validated bool". In the end, you're just validating in a roundabout way and calling it "parsing".

I personally find being robust to errors and having clear error messages is the best option.

Don't focus so hard on getting things right, but rather dealing with things when they go wrong.