Earlier quoted context omitted.
This site's mobile experience mirrors my feelings when having to edit deeply nested and templated YAML.
Is editing deeply nested JSON and XML a better experience than YAML? I don't think so.
That's a Lot of YAML
21–30 of 57 posts
Re: That's a Lot of YAML
#22Re: That's a Lot of YAML
#23Earlier quoted context omitted.
Trailing commas for sure, but I buy the argument that comments would be used to sneak in arbitrary directives and break interoperability. In fact, I’d like to see a less featureful JSON where everything is strings. Trivial parsing, leave interpretation up to the receiver.
For a configuration language, comments are absolutely crucial. You want to be able to say "# This option is set because " to explain why you are configuring it this way to the next person that reads the code (or you, in the future). If the price to pay is that there is some risk some dummy might start parsing the comments as code, so be it. This is not a really a problem in "regular" programming languages, I don't se…
Re: That's a Lot of YAML
#24Yeah theres some problem, but reading a multiline code block (like github actions bash script) as an indent-escaped string is so much better than having to understand crazy triple-escaped characters like "sed \"\\\\\\"name1\\\\\\\"\""
What's even better is just using an actual programming language. Not bash, not sed, not yaml. Just python or NodeJS.
Re: That's a Lot of YAML
#25When it comes to AWS Cloudformation, I love YAML. Can't think of any other positive use though.
Also, due to it failing to work as advertised, I just use `cfn-lint --info -e` to grab the transformed template and use that for realz.
Re: That's a Lot of YAML
#26Re: That's a Lot of YAML
#27Yaml is the language nobody needed. All we wanted was a better JSON format that supports comments and doesn’t crash with an extra comma as the end of a list, eg: [1,2,3,]
JSON5 is exactly what you're looking for and has somewhat decent adoption. I use it for configuration on one of my projects and I really enjoy it.
Re: That's a Lot of YAML
#28I can take credit for one of these, the 63 ways to wrap a string, on line 156.
Amusingly, the Stack Overflow answer you linked in your contribution is the second result in a Google search for "YAML multiline string" or the like, after yaml-multiline.info; the two combined appear to the canonical resource on the web.
Re: That's a Lot of YAML
#29JSON with functions as the high level format and JSON as the low level format is the way to go. Examples include Nix and Jsonnet. They're much nicer to deal with and less error prone.
Re: That's a Lot of YAML
#30Earlier quoted context omitted.
For a configuration language, comments are absolutely crucial. You want to be able to say "# This option is set because " to explain why you are configuring it this way to the next person that reads the code (or you, in the future). If the price to pay is that there is some risk some dummy might start parsing the comments as code, so be it. This is not a really a problem in "regular" programming languages, I don't se…
> This is not a really a problem in "regular" programming languages https://go.dev/wiki/Comments#directives :-D