by bruce511 · 3y ago · 0 comments
That's not something I come across a lot - all my software (that I use) has a visual interface, and so raw editing of text/config files is not something we do.
So context really comes into play here. I can see how this would be very useful for some programs, and near useless for others. And more specifically useful for those who consume user-edited configuration files.
# config.toml
[[podcasts]]
title="Podcast 1"
export_label="Label 1"
[[podcasts]]
title="Podcast 2"
export_label="Label 2"
It's flat for them, but gives me a nice `$podcasts` array of nested objects to work with and they don't need to worry about curly braces, indenting, etc. They can just copy/paste three lines if they need to "add" a new one.Of course, my use case is pretty simple and these are simple string values, but I found it pretty nice.
There's a whole spectrum of config formats including JSON, JSON5, strict YAML, YAML. It's quite messy.
Which is 14 years old.
EDIT: this sounded adversarial which was not my intention. Plenty of libraries do not support 1.2 which sucks, I just meant that it's something solved in theory a long time ago.
> The most tragic aspect of this bug, however, is that it is intended behavior according to the YAML 1.2 specification. The real fix requires explicitly disregarding the spec - which is why most YAML parsers have it.
It is made to be beautiful and easy for a human to read, but the trade-off are a lot of implicit rules you need to be aware of.