My benchmark for yaml/JSON alternatives is "how would I feel explaining it to a busy, sceptical client?"
If the intended audience is purely developers, then sure. JSON (with the addition of comments and trailing commas) is just fine.
White space has the additional advantage of agreeing with itself. Other demarcations can have issues where the indentation and the structure contradict each other.
Please stop making code easy for non-coders. They don’t want to read it. They never did. They just want this damn box to work.
Just put the file in the root folder, and keep it as simple as possible and you should be fine? I mean, if they manage to write yaml correctly and consistently C is no match?
I wish it could be displayed with braces though, I wonder if someone already has built that as an extension for editing / viewing yaml files.
That's false. http://p3rl.org/JSON::XS#JSON-and-YAML
With that said if they weren't complaining about white space they'd be complainit about missing semicolons, missing/extra commas, missig equals signs, missing closing )]} or whatever.
I can definitely think of a broad range of people where I'd be happy to recommend they use text files for config and data but I wouldn't be happy if those text files needed to follow the rules of JSON syntax.
I mean - to some extent I would rather not edit JSON. It's not a terribly ergonomic experience. If I had to design a format for my own use, it would be indentation based and probably look a little bit like YAML, Markdown or similar.
I'm not clear exactly what the "it" here refers to but as I mentioned in other comments it's fairly self-evident that indentation is easier to visually parse than braces. A simple thought experiment - would you find it easier to skim read code where the indentation was consistent with the bracing or where it was inconsistent? Your brain registers the indentation first and you only resort to counting braces if there's a reason to doubt the former.
Nobody advocates for "braces are better without indentation".
This surely implies that (practically) everyone agrees indentation is carrying most of the weight of visual indication of structure.
Of course "everyone" might be wrong - but that's a fairly tricky corner to defend.
^^^ THIS ^^^
My benchmark is this: can an autoformatter do its job every time without breaking something that's technically working right now but possibly formatted wrong?
Every data format that cannot comply with this contains in it a huge waste of time. Even as a python programmer, I extend the same rule to programming languages.
Or, NODE <name> .. END .
But I find it incredibly annoying to estimate indentation when lines are wrapped in an editor (or webpage). Or, to a lesser extent but still throws me off, when multiple blocks end at the same line. Or when pasting blocks into another block, and having to double check to make sure the indentation was carried over correctly. I like editors that visually show indentation characters.
it makes a difference on how it is parsed, so it's more than a devs preference
Personally I mostly use indent to read code, so requiring that the indent matches the semantic nesting makes it much easier for me to understand.
I get the original was talking about client facing config files. I'd rather see INI style config files personally.
If you're writing ugly code, braces or spaces won't save you. Just don't write ugly code.* Write it like the next person to view your code is an axe murder that knows where you live, so don't make them mad. You can minify later.
*I'm ignoring Perl, as it's always ugly
If it was code, an indentation error would often not compile or show errors or fail tests.
Configuration in YAML is much worse: most of the time an indentation error goes undetected until an application starts misbehaving.
Significant whitespace is perfectly ok for code but a huge footgun for YAML
Truncate YAML and in most cases you still have valid YAML.