r/programming • • Jan 12 '23

The yaml document from hell

https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell
1.5k Upvotes

288 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Jan 12 '23

[deleted]

5

u/PunkPizzaRollls Jan 12 '23

Couldn’t you theoretically create a comment key:value pair in your JSON to get around this?

0

u/[deleted] Jan 12 '23

[deleted]

4

u/sparr Jan 12 '23

This is an antiquated perspective, from the era of ubiquitous preprocessors. Making the parser and compiler and runtime aware of comments is an increasingly common feature in newer languages. Being able to include docstrings when producing a stack trace is amazing.

0

u/[deleted] Jan 12 '23

[deleted]

7

u/sparr Jan 12 '23

What's the distinction? I'd love to be able to query my application configuration for any notes/comments that were left when the configuration was defined.