Re:XML is better than YAML
by throwawaymaths on Thursday September 21, 2023 @09:21AM
(#37597231)
The thing is if you're using it as configuration language, object notation is correct, not markup.
[ Parent
| on HN ]
I'm curious why you think that is? Especially since you are likely to want to style the configuration for display to the user in many cases, having it be a document makes a lot of sense.
That is, if the value is something you would expect to be able to show to a user, then it probably shouldn't be at attribute. If it is a value that changes how you would show it, then attribute makes a lot more sense.
I also think a strong adherence to any preference between attribute and markup is a touch too dogmatic. The only real distinction at the language level is if you allow children, or not. If it can have children, it pretty much has to be a child and not an attribute.
Re:XML is better than YAML
by throwawaymaths on Thursday September 21, 2023 @11:55AM
(#37599540)
Ok forget the difference between attribute and markup. What is the "right" way to think of this:
<foo>
<bar>1</bar>
<bar>2</bar>
<baz>3</baz>
<baz>4</baz>
</foo>