title: Web Browser's Tolerance of Seemingly Malformed files
body: <p>What is the <strong>history</strong> of browser tolerance of what appears to me as &quot;malformed&quot; code? By contrast, traditional programming languages are very intolerant of seemingly trivial errors (ex. missing ';', newlines at end of files for ANSI C, forgetting an import for ArrayList in Java, having the line &quot;5;&quot; without a left-hand assignment)?</p>
  <h2>What I mean by apparently malformed code</h2>
  <p>The other day I was generating HTML pages with JSP and when viewing the output I thought &quot;Wow, that table looks awful, better style it.&quot; <em>So I go to the .jsp file, look for the &lt;table&gt; tag, looking for the &lt;table&gt; tag, and ....... its not there</em>. Had the thead's, tr's, td's, tfoot's but no table wrapping up them.</p>
  <p>Coming from other programming languages (.NET languages, C, Java, Ocaml, etc...) the idea that my web browser, <em>all</em> common web browsers, accept broken html still surprises me. Some of the cases where it does this I can understand, for example if it doesn't recognize a cutting edge new experimental HTML9 tag. But I'm still struggling to understand why browsers will accept errors in HTML, CSS, or Javascript like defining rows outside of a table or calling functions that are undefined. In ANSI C, if I forget a newline at the end of my file the compiler will scream at me a minimal of two times before failing to compile! Yet Chrome, IE, and Mozilla seems to let HTML, CSS, and Javascript get away with murder.</p>