logoalt Hacker News

nine_k12/09/20241 replyview on HN

The problem is that self-restraint only takes you so far. Typos exist. Human mistakes exist. Machine errors exist. Malicious inputs exist.

A good parser does not just accept the inputs you find valid, but also rejects inputs you deem invalid. Running a linter that would report or amend all the footgun-wielding features of yaml before parsing is tanamount to running another parser. Then why bother :)


Replies

AdieuToLogic12/10/2024

All good points. My philosophy to address same is to employ test suites as a form of sanity checking for JSON/YAML/XML/et al configuration resources.

Still, it would have been nice if YAML had reduced the surface area to verify in order to establish confidence in its content.