Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

HTML had the opportunity to get better with XHTML and strict enforcement of schemas and XML syntax (which I'm willing to bet Android and Flex require).

The problem was that doing so broke most of the web, or was not internalized by page creators. So we're stuck with the current situation (bad markup, crufty designs, etc.).

Imagine if the first HTML editors forced a schema check before save. I think we'd be in a much better place now if they did...



The myth that the web would be better with strict XML parsing is convincingly debunked here: http://web.archive.org/web/20110514122249/http://diveintomar...

Web pages (unlike Android layout files) are complicated composites of multiple data sources that are generated on-the-fly, and are combined in complicated (but sometimes low-tech) ways like string manipulation. Under such circumstances, it is simply too hard to create perfect XML every time.


That isn't really related to what he said at all. Sure web browsers should be forgiving in what they except, but dev tools shouldn't be. How would you like the C compiler that tried to interpret any old chicken scratch as a valid C program? Never a compiler error again!


> How would you like the C compiler that tried to interpret any old chicken scratch as a valid C program? Never a compiler error again!

Oh fun, bad analogies time! How would you like it if your word processor refused to save a text document because it detected an incomplete sentence?


Nope no analogy. If I expect a machine to understand a language, then it had better be able to determine weather or not a document written in that language is valid. It doesn't matter if it is a programming language or a mark up language. Permissive modes are great for accepting the work of others, but when learning how to write that language in the first place a strict interpretation is best. That way you can focus on getting it right.


C compilers do this all the time. If you're lucky, they'll warn you about undefined behavior as they do it, instead of just silently making all sorts of optimizations because the standard allows them to.

Now as it happens, C compilers have a syntax validator as part of them. Lots of HTML editors, past and present, have used HTML validators too...


What dev tools? Any text editor is a dev tool that can and is used to create HTML for browsers to (forgivingly) accept.

That's actually fundamental design aspect of HTML which was partly responsible for it's popularity.


Last I checked IE, Fire Fox and Chrome all had a dev mode. Sure they might not have had them at first but a strict mode or a parse check or some thing of that sort would have been helpful all along.


Of course, but there are way of combining data sources that will produce valid XML.


I would argue the contrary, that the very reason why HTML took off so fast was that any fool was able to craft a site, and it would work even if it had a few bugs in it. Failure tolerance is a great feature. Especially if you consider it in the context of document authoring - for which HTML was originally designed for - it's better to read a document that has one unclosed <b> tag in it, than to be completely unable to read it because there's a syntax error in markup.


But the problems sskates mentions would not be helped by better schema compliance; they start and end with the fact that CSS is a miserably poor layout engine that is not powerful enough to effectively separate content from presentation.

HTML itself has its warts, sure, but the fact that we end up constantly resorting to HTML and/or Javascript edits to do things that should be happening in CSS alone is, to me, a much worse problem.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: