Hacker News new | ask | show | jobs
by joshvm 2869 days ago
Back to doctypes? I remember as a younger person being very confused at why there were about five different options. Do I use strict? transitional? xhtml?

There are multiple versions of ECMAScript, analogous to whether your compiler supports C++11/14/17/etc. It doesn't make sense to say "let's all use ES8" because ES8 is back-compatible (I think). It's up to the browser to decide what to support, and you have the same issues in C++ where some compilers don't fully support feature X.

Then, which APIs do you deprecate? How do you define "old"? Anything prior to stable is a good rule of thumb, but since JS can be loaded locally, people will use whatever they downloaded and that they know works. Some people advise not to use auto-updating CDNs precisely because a patch might break your page. And remember it's mostly down to the API developers to ensure compatibility across major browsers, not vice versa.

There's nothing wrong with vanilla JS. Really we just need to get people to be less excited about using frameworks for tiny projects that don't require them. Or you have problems like e.g. some text transition that requires loading every single version of the typeface.

2 comments

Yes, reminds me of "we have 14 different standards. Let's implement a new one that encompasses all that is needed and obsolete the other ones. Now, we have 15 different standards"
But this is exactly what is happened, just that every new one is ad-hoc, and on top of the olds. Every time a new api happened you create standard + 1 * N browsers.

Eventually, you increase ad infinitum the tech debt, or restart.

I think the cost of the whole web stack is high enough not only for the browser makers but EVERYONE ELSE. Is multiply JS (n-versions) + CSS(n-versions) + HTML(n-versions) * N Browser * N OS.

Now, what other rational option can be offered... push forward and keep doing the same and increase the tech debt? Not exist a way to refactor this?

I believe what will happen is what happens continuously with technology, a new layer of abstraction will evolve and thats it. Most devs want to use some abstraction layer (or build one themselves) and thats it. That's how computers work, just layers of abstractions stacked on top of each other. The underlying details, complexity but also power (eg features, security issues,..) only very few understand.
Credit where it's due: https://xkcd.com/927/
> There's nothing wrong with vanilla JS.

Understatement of the century for 500.