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

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.




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

Search: