4 ms·
I remember a time when the coolest thing you could do with JS was mouse trailing bouncy balls. Since then, a lot changed; one of these is that people see JS as
by pmlnr 10y ago
I remember a time when the coolest thing you could do with JS was mouse trailing bouncy balls. Since then, a lot changed; one of these is that people see JS as salvation from a special hell that doesn't even exist.
That giant ball JS that is included in most sites is absolute nonsense and is not needed in 99% of the cases. We include complete libraries where is should only be a portion.
I'm aware that this is changing, by "compiled" JS - putting together only the required elements - but usually those still have massive overheads.
In my opinion, you should use the tools for what they are the best for. Provide a static, readable HTML first from a backend code - that will run on anything, anywhere; it's accessible, and you've served the main purpose: serving content^1. If you need, add the styling and the animation with CSS. Only after that add the JS layer, which, in my opinion, should mostly be used for data exchange and change triggering.
^1 There are exceptions, there always are; application within the browser, where the main purpose differs from the content delivery. In certain numbers, such as domains, these are the minority; in actual use, it's a different story.
( Imagine a world where the data exchange is not tied together with JS and that we could but other UIs in front of the backends of webapps.. )