Hacker News new | ask | show | jobs
by aaaaaaaaaaab 1653 days ago
Delete a semicolon from a C/C++/Java/C# program, and it won’t compile.

Delete a byte from a zip file, and it won’t unzip.

I don’t see why HTML should be different…

2 comments

Yeah I don’t see how that is supposed to be a benefit?

Why _shouldn’t_ people have to make actually-valid-html? We don’t tolerate “only sort of correct JSON” tightening the acceptable requirements for valid HTML and CSS would likely make using those formats in more places _easier_.

Compiling is something that happens locally and is static - it either compiles now or it doesn't and once you have the final executable you can distribute to your users the syntactical errors or whatever of your source code doesn't matter after that.

HTML is different because it is parsed by the browser the end user is using when it is using it. If a site completely broke like, f.e. how Mozilla treated bad XHTML sites (instead of showing the site itself you'd get some yellow page with the error) when you got a tiny syntax error then anything with user generated content (forums, blogs, etc) or even just generated could be a potential minefield. Especially as websites started adding code from external sources (be it for ads or for things like youtube embeds or whatever).