| ▲ | hackrmn 11 hours ago | |||||||||||||||||||||||||||||||
Every time XML comes up, I feel obligated to share my opinion (I too wrote XML a the turn of the millennium and have seen it become and still witness on occasion it being excommunicated). XML is verbose and therefore uglier than it ought to be. I think most of the haters hate it for that alone -- there's not much else to hate because you don't have to deal with the rest, it's not really imposed on you unless you really have to deal with someone else's XML application. What do I mean? Well, the brackets thing and the necessity to repeat name of every element twice, in correct (LIFO, last in first out) order, isn't great, admittedly. What XML has that the dev-bro alternatives that have flooded the void XML left since, haven't gotten and thus see being reinvented, are: namespaces, attributes and interop using the former two. Sure you can write JSON and YAML (the latter deservingly being incredibly hard to parse correctly -- they tried to design a better XML but failed IMO) -- but these suck as meta-languages because there's not much "meta" there. JSON, for example, allows you create properties and has a few types (kind of more than XML, really) but it leaves semantics up to you and namespaces are up to you to re-invent, poorly. If you think I am stretching the argument, see if you can represent an HTML document (no, not Markdown) with a JSON file. YAML is a similar story, albeit with a few cool things like aliases. I think it's a better attempt to give the world a better XML, but the jury is still out on that one. The killer thing with XML, for better and for worse, was plethora of tools to work with it. I wrote a fair share of XSLT documents to transform data, back when there was momentum in XHTML, for example. XSLT barely supports JSON and it's not pretty. XPath cannot natively understand YAML -- unless you convert it to XML which I guess re-animates XML as some sort of Frankenstein's monster. And even if it were a [pretty] monster, dealing with intermediate representation for the kind of purpose, is a can of worms all of its own. Ironically nobody seems to hate HTML 5, seemingly. Or React basically turned it into a greasy cogwheel nobody needs to look at. Because if you look at it, it's in my opinion an abomination even compared to XML (unpopular opinion) -- the parser is quirky and behaviour is defined by the standard per element type (i.e. some elements need a closing tag and some do not, and what happens if you forget a closing tag is element-specific; care to remember the set of rules to ensure your document renders to your liking?). It has no namespaces but it has "custom elements" which require a dash in the name as poor' man's namespaces and you can't omit one, and now we have a Web of `x-spinner` and `x-carousel` because it turns out everyone rightfully wanted default namespace but didn't get one. Anyway, it's all plumbing, right -- the idea of _writing_ HTML has largely come and gone us by. And I am digressing. | ||||||||||||||||||||||||||||||||
| ▲ | notnullorvoid 10 hours ago | parent | next [-] | |||||||||||||||||||||||||||||||
The one good feature of HTML 5 was the introduction of boolean attributes. It's a feature XML could and should adopt. The whole handling of custom elements was fumbled beyond belief. The HTML spec is a disaster particularly it's parsing rules the complexity of which is used as excuse by HTML spec authors not to improve the language. XHTML was a better path. I think the reason we don't see too many people complaining about HTML 5 is because not many web programmers use it directly, most are using JSX. | ||||||||||||||||||||||||||||||||
| ▲ | conartist6 11 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
What do you think of CSTML? It's my attempt to heal the rift between XML and HTML5, as well as solving all the problems that made XML feel onerous to use... https://docs.bablr.org/guides/cstml It's simple to parse like JSON, it has namespaces like XML (but better), and it doesn't require you to repeat the name of every element twice. | ||||||||||||||||||||||||||||||||
| ▲ | jolmg 11 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
> Well, the brackets thing and the necessity to repeat name of every element twice, As a document format, it's supposed to be hand-written by humans. If you have paragraphs between the opening tag and closing tag, it makes sense to let the reader know what they're seeing the closing of. After deciding you do want to repeat the element name, the angle brackets make more sense. Otherwise, you can have a syntax like LaTeX's. | ||||||||||||||||||||||||||||||||
| ▲ | int_19h 11 hours ago | parent | prev [-] | |||||||||||||||||||||||||||||||
I don't like HTML5 and to this day I don't understand what was actually gained by dropping XHTML. | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||