News for hackers. Stuff that matters.
Re:XML is better than YAML by vbezhenar on Wednesday September 20, 2023 @11:16PM (#37592836)
I know that everyone hates YAML, but in my experience it's not that bad. I'm not using it to its full power, I guess, more like safe subset, and it works fine for me.

XML has its place, but I wouldn't want to replace my yamls with XML.

Re:XML is better than YAML by _ZeD_ on Thursday September 21, 2023 @12:07AM (#37593118)
Them why not json?
Re:XML is better than YAML by emodendroket on Thursday September 21, 2023 @12:41AM (#37593285)
YAML gets cleaners diffs when you edit it.
Re:XML is better than YAML by TeMPOraL on Thursday September 21, 2023 @02:54AM (#37594060)
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.
Re:XML is better than YAML by EamonnMR on Thursday September 21, 2023 @12:33AM (#37593244)
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.
Re:XML is better than YAML by vbezhenar on Thursday September 21, 2023 @12:14AM (#37593147)
YAML is way less verbose than JSON. Something as simple as multiline script is terribly suited for JSON.
Re:XML is better than YAML by baq on Thursday September 21, 2023 @02:55AM (#37594063)
The problem is when you want to put a script into yaml you should stop and think what it is you’re actually doing.
Re:XML is better than YAML by danmur on Thursday September 21, 2023 @01:27AM (#37593525)
* 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.
Re:XML is better than YAML by danmur on Thursday September 21, 2023 @08:45AM (#37596802)
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)

Re:XML is better than YAML by vaylian on Thursday September 21, 2023 @05:09AM (#37595104)
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.

Re:XML is better than YAML by mplewis on Thursday September 21, 2023 @02:56AM (#37594069)
JSON doesn't support comments.
Re:XML is better than YAML by emodendroket on Thursday September 21, 2023 @12:40AM (#37593283)
I don't hate YAML. Who hates YAML?
Re:XML is better than YAML by baq on Thursday September 21, 2023 @02:54AM (#37594057)
I didn’t, then I’ve started writing GitHub actions and now I do.
Re:XML is better than YAML by pydry on Thursday September 21, 2023 @06:45AM (#37595807)
Github actions is fine provided you keep the YAML as short as possible and try to call out to a normal script to do everything - i.e. use it as config.

The problem comes when you try to use it as a programming language in and of itself (which MS encourages because it's a route to vendor lock in). It's a shitty, shitty programming language with shitty debugging tools.

Re:XML is better than YAML by baq on Thursday September 21, 2023 @07:49AM (#37596261)
To your first point: yes.

To your second point: yes, yes, and very much yes.

Creating complex release workflows within GHA is hell given the debugging situation and that's what we're using because 'it's there, use it, everyone's using it'. Send help

Re:XML is better than YAML by orphea on Thursday September 21, 2023 @05:42AM (#37595358)
I do. YAML can return to the rotting hole it's from.
Re:XML is better than YAML by funcDropShadow on Thursday September 21, 2023 @05:49AM (#37595419)
Me and anyone who read https://noyaml.com/ .
Re:XML is better than YAML by emodendroket on Thursday September 21, 2023 @01:16PM (#37600783)
So a handful of well-known pitfalls and complaints about how it’s easy to represent the same information differently. Yeah, switching to XML definitely solves that problem.
Re:XML is better than YAML by sph on Thursday September 21, 2023 @07:19PM (#37605784)
The fact that you know them doesn't make them any better, it just proves you've got Stockholm Syndrome
Re:XML is better than YAML by emodendroket on Thursday September 21, 2023 @09:03PM (#37606595)
I get your point but there is exactly no technology you can use without some known pitfalls, so you pick the one whose pitfalls are the least catastrophic or bothersome to you.
Re:XML is better than YAML by sethammons on Thursday September 21, 2023 @10:32AM (#37598193)
I have literally left a 300k+/yr job, twice, due to having to write and maintain too much yaml.

Templating and significant whitespace is the worst. 10 commits in a row of "error on line 1" until helm finally parses what you want.

I am a software developer with extensive distributed systems experience. I like thinking about systems, not guess-and-check on config templates that become a bespoke DSL with no proper way to debug.

Our config structure requires similar but individualized configs for on-prem and the cloud. These can deviate for the region, the data center, the logical cluster, and at the individual node level for A/B or canary reasons. And of course local dev. You need to have a way to know where the deviations are, like different regional hostnames for services you connect with, different node sizes or replica counts, and different labels, any of which may or may not be correct and will cause an incident if wrong.

Search you yaml PRs, and I bet you will find a commit along the lines of "because yaml."