News for hackers. Stuff that matters.
Re:XML is better than YAML by sdumi on Wednesday September 20, 2023 @02:33PM (#37588029)
I'm not sure I understand his example:

    “I need to configure this server and the server needs to know if this value is true or false.”
    No, that’s bad. Don’t do that. That’s not a good use for XML.

But on the other hand, if you need to mark something bold, then XML is a great choice.

I see both cases as being quite equivalent: whether the server needs to know that a value is true/false or that it needs to display something as bold feels quite the same thing, isn't it?

Or does he mean that you cannot easily retrieve the value of an arbitrary XML element? Whereas to display a document you just process it sequentially and do not need to 'retrieve' arbitrary data. Is this it?

Re:XML is better than YAML by gilcot on Wednesday September 20, 2023 @02:47PM (#37588280)
It's only a construction to justify author's biases.
Re:XML is better than YAML by earthboundkid on Wednesday September 20, 2023 @10:12PM (#37592513)
Literally every article is that. What’s your point?
Re:XML is better than YAML by gilcot on Thursday September 21, 2023 @02:45PM (#37602138)
Oh, I was only saying that the article isn't saying that you cannot easily retrieve the value of an arbitrary XML element. It simply putting together selected examples that should deserve YAML and convince us that we must swear XML true.

Well, life isn't black and white, but somewhat greyscale. From my experience, none is better and they don't share the same use-cases.

Re:XML is better than YAML by TRiG_Ireland on Wednesday September 20, 2023 @03:24PM (#37588804)
I think I'm with the author on this. The two scenarios are very different. Bold text is probably a span of text within a larger block of text: delimiting it with an opening and closing tag makes sense. A config value is a boolean switch.

This makes sense:

    <element>Some text here. <bold>Some more text here.</bold> And yet further text here.</element>
This does not:

    <value>true</value>
That should be:

    value: true
Re:XML is better than YAML by stvltvs on Wednesday September 20, 2023 @07:12PM (#37591294)
A better XML encoding would be the following, optimally with a schema that would define allowed values.

    <setting name="foo" value="true"/>
Re:XML is better than YAML by TRiG_Ireland on Wednesday September 20, 2023 @08:31PM (#37591846)
That still feels ugly and verbose to me.
Re:XML is better than YAML by stvltvs on Wednesday September 20, 2023 @08:48PM (#37591949)
I don't disagree, but it's easier to rigorously validate than lighter-weight markup languages, if that's important to the use case.