3 ms·
It's possible to create systems that are effectively impossible to use safely. I suspect that javascript on the web is a pretty well designed footgun, such that
by jaggederest 8y ago
It's possible to create systems that are effectively impossible to use safely. I suspect that javascript on the web is a pretty well designed footgun, such that it's the exception to find someone who can't hurt themselves in their confusion.
- stephengillie 8y agoIf web browsers could interpret another language, would you make the same argument against it?
- itronitron 8y agoyes and no, the two big issues are that a) the SPA has to work within the very poorly documented render loop, for lack of a better term, of the browser and b) Javascript has some very idiosyncratic idiosyncracies and lacks some basic language functionality that is present in most languages
- tambourine_man 8y agoPlease explain what’s poorly documented in current browsers render loop.
- itronitron 8y agook, if a div is added to the page body, and then another div is removed, what does the render loop do? any pointers to documentation are appreciated :)
- tambourine_man 8y agoQuick Googling: https://developers.google.com/web/fundamentals/performance/critical-rendering-path/render-tree-construction https://developers.google.com/web/fundamentals/performance/c... https://developers.google.com/web/fundamentals/performance/rendering/ https://developers.google.com/web/fundamentals/performance/r... https://developers.google.com/web/fundamentals/performance/rendering/simplify-paint-complexity-and-reduce-paint-areas https://developers.google.com/web/fundamentals/performance/r...
- jaggederest 8y agoI think a big part of the problem is precisely the interpreted and web browser part of your post, so you're right, but I think at this point it's difficult to disabiguate the browser, the DOM, and JavaScript. I think JavaScript as a language also has problems that make it difficult to do large scale engineering with, thus transpilers. Maybe WebAssembly will provide fruitful ground for new, simpler, and more rigorous languages. I also think that much of modern web apps could be accomplished better with HATEOS apps doing pure server side. But I will allow that my beliefs there are at least partly nostalgic
- zachrose 8y agoUsing Elm, even a little bit, has given me a perspective on what a different language can do in the browser. If you subscribe to Gary Benhardt’s Capability/Suitability theory of programming history [1], JavaScript is the highly capable technology that can be used for any sort of architecture you can imagine, and Elm is a turn towards suitability that says, “some of those architectures are unsound or have a very low floor for quality.” You might want to abstract over DOM APIs for different reasons, but at their semantic core they are fine. [1] https://m.youtube.com/watch?v=NftT6HWFgq0 https://m.youtube.com/watch?v=NftT6HWFgq0
- canhascodez 8y agoI think that JavaScript is a really interesting and unique language. I would rather have had Perl in the browser. JS seems more appropriate as a relatively obscure academic language. Note that I tend to view trying to enforce types or use classes in JS as being misguided and futile, which does not seem to be a mainstream view.