
Web Truths: JavaScript can't be trusted - daviesgeek
https://christianheilmann.com/2017/09/26/web-truths-javascript-cant-be-trusted/
======
masswerk
> "JavaScript isn’t like CSS or HTML. Both these building blocks of the web
> are fault-tolerant. This means when you write invalid HTML, the browser
> tries to fix it. If you use bleeding edge CSS in an old browser, it ignores
> it. Not so with JavaScript."

This really isn't a statement about the language, but about its use (and even
more about frameworks). If your script breaks, your browser still happily
displays the page as-is, if there's a type error, the language tries to make
the best of it (much to its criticism), there's even a self-correction
mechanism in the syntax (semicolon auto-insertion). If your first script
silently and gracefully fails on an error, your other scripts will still
execute (just like any other HTML tag). It really depends on the use, and the
same criticism may be applied to, say, CSS:

E.g., we may come to the – rather amazing – conclusion that putting all the
text content of a page into the content attributes of the before and after
pseudo-classes is the only way to do it, because it's a) a rather new feature,
b) sexy, c) CSS is then your single source, and d) why not? Then, hey, CSS is
now Turing complete, why not build an entire client-side framework on this?
And, maybe, a headless CSS engine for the backend? And, boom, everything fails
on a single malformed CSS expression...

