Why Not document.write()?
csswizardry.com
csswizardry.com
I thoroughly enjoyed the spiritual essence and relative purity of HyperCard at the time in the 1990s.
Edit: @ly: Apologies, I should have been more specific and clear. Referring to the complexity matrix in terms of what may or may not cause page rendering to block at any given moment. Complexity in this location all but ensures you will make a suboptimal decision during development unless you run every release candidate through Google Page Speed.
Arguably Node took off because it allowed an already-existing huge ecosystem of libraries, tools, and developers to be leveraged for the back end, with all of those resources in turn coming from the browser.
It didn't. JS didn't have a huge set of existing tools and libraries when Node showed up. And the ones that did exist certainly didn't work in Node, considering they were written for the browser without a care in the world for other environments.
You can't possibly know that.
I'm sure of it.
From my perspective the problem is even in the name itself, the D in DOM stands for document, which is exactly the problem. The DOM was never designed as an application framework but we've shoehorned it into that role.
It's still in the browser, of course—because it has to be. But it's not as if people are being taught to use document.write and then having the rug pulled out from under them in a "sike!" moment when it's revealed that this often used fixture of the programmer's toolbox is is actually problematic. What strikes me as odd about the article is that we've reached a point where not only are people not being taught to use document.write anymore, they're not being taught not to use it anymore, either. That's how much of a non-issue this is. So what's with the article belaboring the point?
It’s just many people have chosen not to learn how browsers actually work
As far as write once/run anywhere, Deno has been pretty good at showing this is still limiting but could be much less painful if the server runtime shared more applicable APIs instead of ad hoc doing idiosyncratic stuff.
I’ll definitely agree that JS is a bit lisp like, but not due to runtimes. It’s been a build target with build time semantics for a long while. Unfortunately it’s unlike lisp in that those semantics are part of arbitrary tooling which don’t always agree but have been forced to coexist, rather than semantics of the language itself.
Is there any tools that you can use to help detect stuff like this? In order to do performance optmizations
Off-topic: Apparently the URL flavor this month is infected with the .dev TLD proliferation g-corp agenda (as is golang.org -> golang.dev). Do cool URLs ever really change?
if(condition) document.write('<!--')
How else accomplish that?
You can have a cached static html document with really huge (conditional) comments with tiny performance loss. display:none for example still does all kinds of things. Inserting html with js is even worse.
Disclaimer: I didn't read the article and am just bikeshedding.