views:

55

answers:

4

Hi,
I'm looking into HTML5 and I'm puzzled why it goes so easy on well-formedness.

<div id="main">  
<DIV ID="main">  
<DIV id=main>

are all valid and produce the same result. I thought with XHTML we moved to XML compliant code at no cost (I don't count closing tags as a cost!). Now the HTML5 spec looks to be written by lazy coders and/or anarchists. The result is that from the start of HTML5 we have two versions: HTML5 and the XML compliant XHTML5. Would you consider it an asset if C would suddenly allow you to write a for construct in the following ways?

for(i = 0; i < 10; i++) {  
for(i = o; i < 1o; i++) {  // you can use "o" instead of "0"  
for(i = 0, i < 10, i++) {  // commas instead of semicolons are alright!  

Frankly, as an XHTML coder since many moons I feel a bit insulted by the HTML5 spec.
Wadya think?
Steven

edit:
Mind the "wadya": would you as a customer accept a letter with "wadya" written instead of "What do you"? :-)

+1  A: 

HTML 5 is not an XML dialect like XHTML is.

What made HTML so popular was the fact that it tolerated mistakes, so just about anyone could write an HTML page.

XHTML made is much more difficult, so w3 decided to revert to a non XML standard for HTML 5.

Since XML is stricter than HTML, you can always write your HTML to be XML compliant. Make sure attributes are in lower case, use value delimiters, elements have closing tags and use correct XML escaping where needed.

Oded
That is what stevenvh is complaining about
David Dorward
But you can make HTML5 XML compliant?
stevenvh
XHTML didn't really make it more difficult, but since there was no cost to not caring, most people didn't bother.
David Dorward
@stevenvh - There is nothing that stops you from making your HTML also XML compliant.
Oded
"XHTML made is much more difficult". I don't agree. It's more like paying attention to your language, like making sure you write "receiver" instead of "reciever".
stevenvh
@stevenvh - It did make it much more difficult. I am not talking about programmers or web professionals, but for mom and dad types who are not very technical. Those are the people who made the web popular.
Oded
@Oded - mom and dad types typically don't know the first thing about HTML; they use Word or -god forbid- Pagemaker to generate code. If either program would produce XHTML so would they.
stevenvh
@Oded - "There is nothing that stops you from making your HTML also XML compliant." That's exactly my point: that's what HTML5 should have been. Nobody can argument that it complicates things. How difficult is it to use quotes and lowercase text and close you tags?
stevenvh
A: 

Better that the spec allows it then it forbids it, everyone does it anyway, and browsers have to error correct.

XHTML never really took off, not least because MSIE never supported it (pretending it is HTML by sending a text/html content type not withstanding).

David Dorward
"Better that the spec allows it". Yes, but where does this stop? I'd like my tags in [] instead of <>. :-) "everyone does it anyway". Is that like everyone does copy software anyway?
stevenvh
SGML is case insensitive and has rules for when quote marks around attribute values may be omitted. People are used to writing for clients originally designed to handle a version of HTML that was implemented as an SGML application. Telling them they can't simply doesn't work in many cases (as the ratio of valid to invalid pages with an XHTML doctype at the top will attest).
David Dorward
A: 

Honestly, your question answers itself. "We have two different specs." Each spec addresses a different level of conformance, and they do so for a reason. As much as we might loathe the notion of "backwards compatibility," it's a burden we have to bear, and HTML5 is far better at maintaining it than XHTML5 will ever be.

Mike Hofer
Well, it's the fact that we already have two specs to start with that frustrates me. History learns that different specs tend to diverge rather than converge. I predict that we'll have several more versions of HTML5 by the time the spec will be finalized in 2022.
stevenvh
A: 

For natural parsing the quotes aren't necessary in the first place.

Regarding case, HTML elements are reserved regardless of case; for example, you can't define your own DiV or Div.

HTML is a markup language where speed and simplicity is a greater priority than consistency.

While arguable, this matters greatly to search engines; documents with quoted attributes and any kind of error are very expensive to process. It's funny -- the quoted example in HTML docs has 'be evil' in quotes; as to say that, not using quotes is not being evil.

nessence