The reason is that the language was designed in a week with a "product manager" pushing the developer's design into something that only has "is a programming language" in common with it during that week.
Honestly, I can point you to languages with worse design than JS.
There was an idea (perhaps from BASIC) that "scripting" means permissive. Instead of failing fast, it was designed to fall back to something that works (e.g., '1'+1=2). That's a terrible design decision, and JS tried to reverse it in every future iteration.
The other two big issues for me were: trying to imitate Java (with the new keyword, instanceof, and null). The prototype mechanism that JS took from Self is simpler and easier to understand if you leave out those constructs.
The other issue was the lack of modules. That was part of the idea that JS was for short, interactive scripts on a page; the initial version didn't plan for how we use it today.
Other than that, I prefer JS over Perl, C, C++, PHP, shell scripting, or TCL.
Edit: Actually, '1'+1 is '11' in JS (facepalm), but '1'*2 converts to a number. That's why it was a terrible idea. But, to be fair, many "scripting" languages did that kind of type coercion. I guess that language designer hated cryptic compile errors.
More and more, this has been weaponised: "No, we're not evil! We never intended for this to happen. It was just an accident" Is something I hear too often
C was 1972, and golang was 2007. It's not that no new concepts <cough>exceptions</cough> were discovered in between.
A pen is more elegant than a chisel.
Here in Belgium, there's "a bit" of asymmetry: the price per kWh I pay from the grid is roughly 3 times of what I get when I inject. I also have a fixed cost per year to have the right to inject. I knew this before I installed solar and have a home battery, so it only happens during summer.
It is. Actually the best candidates for 0% seems to be the IPA beers as the bitterness adds this little "punch" classic zero alcohol beers seems to suffer from.
it was called "Slow arse". This was because it was rather reluctant in handing out resources (memory fe).
Having fought it, I remember the system APIs being really well defined and picky (which was good). At one point, the C compiler had some identity issues "am I 32 bit, or 64 bit?"
pattern is there: first hit a public place (market, ...), then when people are scrambling to help, hit them again. "double-tap".
Seen in Gaza, Ukraine, Syria, Yemen, ...
It's quite cynical, the topic has its own Wikipedia page:
reply