Re:XML is better than YAML
by _ZeD_ on Thursday September 21, 2023 @12:07AM
(#37593118)
Them why not json?
[ Parent
| on HN ]
Re:XML is better than YAML
by emodendroket on Thursday September 21, 2023 @12:41AM
(#37593285)
YAML gets cleaners diffs when you edit it.
That's more of a problem with diff tools, though, which like almost all tooling and even programming languages, make the mistake of treating code as plain text.
Re:XML is better than YAML
by emodendroket on Thursday September 21, 2023 @01:09PM
(#37600664)
OK, well, if you want to invent a new VC tool that can parse arbitrary languages into a syntax tree and make a useful diff and then convince everyone to use it instead of git then maybe I’ll stop using YAML.
Re:XML is better than YAML
by MenhirMike on Thursday September 21, 2023 @06:36PM
(#37605408)
Semantic Diff tools already exist. Haven't looked at ones that specifically support YAML, but e.g., graphtage claims to do so.
If you want something editable by hand, yaml is much nicer than Json because you get comments and you don't need to worry about missing a bracket.
Re:XML is better than YAML
by mistertoolbox on Thursday September 21, 2023 @12:46AM
(#37593324)
I have no big love for json or yaml, but i'd gladly take worrying about missing brackets over worrying about the handful of whitespace-related gotchas in yaml.
YAML is way less verbose than JSON. Something as simple as multiline script is terribly suited for JSON.
The problem is when you want to put a script into yaml you should stop and think what it is you’re actually doing.
* JSON doesn't have comments. I could stop right there because that's a total deal-breaker for me for anything that's supposed to be read or written by humans.
* JSON doesn't handle multiline strings.
* JSON is not especially readable (no structure enforced, braces and double quote mandatory).
* JSON can't load YAML but YAML can load JSON.
(lots more)
Re:XML is better than YAML
by deafpolygon on Thursday September 21, 2023 @03:21AM
(#37594251)
Given this, I'd much rather XML any day. You can comment using <!-- Comment --> blocks.
I have zero problems with XML. Hard sell though.
It's annoying though because it's so mature compared to everything similar (even YAML, which I obviously quite like); like if you make an XSD for your config files everyone gets free editing features (not just validation, completion as well, even completion of attributes)
No trailing commas makes editing JSON a pain
Re:XML is better than YAML
by thaumasiotes on Thursday September 21, 2023 @06:41AM
(#37595768)
The lack of trailing commas isn't the problem. The problem is the intermediary commas.
Those are used in JavaScript to give you the option to provide an expression in place of a single term. But that's not even allowed in JSON, so the commas aren't serving any purpose at all.