Yes, this probably shouldn't bug me.
But it does!!
Why does XML have such verbose closing tags? Not only does it make documents uglier for humans, it needlessly introduces the risk of mismatched (or misspelled!) opening and closing tags.
Even if we wanted to require closing tags, why do we need to include the name of the opening tag inside the closing tag? There is never any ambiguity in XML, because innermost tags must be closed before closing outer tags!
For example:
<thisIsSomewhatLong>
Hello, world!
</thisIsSomewhatLong>
...is so much more verbose than:
<thisIsSomewhatLong>
Hello, world!
</>
And it doesn't resolve any ambiguity, either for humans or for computers.
Does anyone know what the rationale is for this rule? What risks are avoided by disallowing empty closing tags?
Because it improves readability, XML was born not to be efficient or concise, just to be easy to work with.. and if you think having </>
wouldn't create ambiguities it is just because you are indenting the code. If you leave out indentation (which is a really weaker constraint compared to having the name in a closing tag) then it becomes a mess.
A simple example?
<A><B><C><D>foo</><D>bar</></><H>baz</></></>
You think it's so readable? It's hard to understand where <H>
is without counting closing tags..