Live data from Hacker News

XML is a cheap DSL

unplannedobsolescence.com

271–274 of 274 posts

Re: XML is a cheap DSL

#271
post #259

Earlier quoted context omitted.

This scripting is not a part of YAML. It could be done in JSON as well: {"command": [ "/bin/sh", "-c", "rm -rf $HOME" ]} In fact, this is completely equivalent to your YAML.

The difference is that in YAML it's kind of expected (the second pseudocode example is from Home Assistant where almost everything nontrivial requires embedding scripting inside your YAML) while I've never seen it done in JSON.

The use cases for YAML that don't involve any sort of scripting vastly outnumber the use cases for YAML that involve embedding scripts into a document; so it's a little unfair and inaccurate to say that "in YAML it's kind of expected".

It is more fair to say that if your document needs to contain scripting, YAML is a better choice than JSON; for the singular reason that YAML allows for unquoted multiline strings, which means you can easily copy/paste scripts in and out of a YAML document without needing to worry about escaping and unescaping quotes and newline characters when editing the document.

Re: XML is a cheap DSL

#272

Earlier quoted context omitted.

I consider CSV to be a signal of an unserious organization. The kind of place that uses thousand line Excel files with VBA macros instead of just buying a real CRM already. The kind of place that thinks junior developers are cheaper than senior developers. The kind of place where the managers brow beat you into working overtime by arguing from a single personal perspective that "this is just how business is done, son…

Ah, such youthful ignorace. You just classified probably every single bank in existence as "unserious organization"

[deleted]

Re: XML is a cheap DSL

#273

Earlier quoted context omitted.

Ah, such youthful ignorace. You just classified probably every single bank in existence as "unserious organization"

They kind of actually are, though. Not because they use CSV's but because, as an industry, they have not figured out how to reliably create, exchange, and parse well-formed CSV's.

I go back to my statement that skilled people don't complain about their tools because the tools they use are the best and they have nothing to complain about.

An organization that cared about data integrity absolutely could make CSV work. But that same organization would not use CSV because there would be no point in putting themselves through that kind of Mickey Mouse exercise.

Re: XML is a cheap DSL

#274

Earlier quoted context omitted.

I've said it before, but I maintain that XML has only two real problems: 1. Attributes should not exist. They make the document suddenly have two dimensions instead of one, which significantly increases complexity. Anything that could be an attribute should actually be a child element. 2. There should be one close tag: ` ` which closes the last element, which burns a significant amount of space with useless syntax. O…

I disagree on several points here: 1. I think attributes absolutely should exist. They're great for describing metadata related to the tag: e.g. element ID, language, datatype, source annotation, namespacing. They add little in complexity. 2. The point of a close tag with a name is to make it unambiguous what it's trying to close off. It sounds to me like what you want is not a better XML, but just s-exprs. Which is…

[dead]
Post reply on HN