Netscape è riuscito a dare un vantaggio al proprio browser Web, quindi si è bloccato.
Da questo video di Douglas Crockford: perché la sintassi è così com'è, perché si chiama JavaScript, perché Microsoft lo ha copiato e perché alcune delle parti difettose sono presenti. (Non ho copiato le parti su ECMAScript, ma questa è anche una storia interessante):
One of the things [Netscape] wanted to do was to put interactivity
back into the browser, because we had lost interactivity when we went
to the browser model. [...]
In order to do that, they hired this guy, Brendan Eich, who had been
at Silicon Graphics. Brilliant guy. In his interview he said he wanted
to write a Scheme interpreter, and they said ‘that’s great, that’s
just what we want’. After they hired him they found out what Scheme
was, and they said ‘no, no, no, you can’t do that. People won’t like
that. Do something that looks more like Visual BASIC, or Java,
something people like.’ [...]
Brendan took elements of all three of these languages [Java, Scheme,
and Self], and a little bit of his own, and put them together into a
new language that was called LiveScript. [...]
LiveScript was going to become one of the key technologies for
Netscape going forward. It was going to be in Netscape Navigator 2, so
you could have LiveScript applications running on the client-side, and
on the server-side; Netscape’s LiveWire server had server-side
JavaScript in it. This was back in ’95, so JavaScript was there from
the very beginning. It was very clear at the time that there was a lot
of excitement about Java and the Netscape browser, and Sun and
Netscape decided they needed to work together against Microsoft
because if they didn’t join forces Microsoft would play them off
against each other and they’d both lose.
The biggest point of contention in that arrangement was what to do
with LiveScript. Sun’s position was: "Well, we’ll put Java into the
Netscape browser, we’ll kill LiveScript, and that’ll be that." And
Netscape said no, that they really believed in the HyperCard-like
functionality, and they wanted a simpler programming model in order to
capture a much larger group of programmers. So there was an impasse,
and the relationship almost broke up, when I think Marc Andreessen -
and I have been able to document this, but people have told me - Marc
Andreessen, maybe as a joke, suggested: ‘let’s change the name to
JavaScript.’
[laughter]
And it worked, except that Sun claimed ownership of the trademark.
Even though they had nothing to do with the language and they tried to
kill the language, they said ‘we own the trademark, but we’ll give you
a license to use the trademark’. Netscape said ‘great, an exclusive
license only, we can call it JavaScript, that’s fine’.
At Microsoft they’d been watching this with some alarm, particularly
when folks at Netscape were saying that Netscape Navigator was going
destroy Microsoft. Microsoft said ‘oh, we don’t want to be destroyed’.
It turned out Netscape Navigator didn’t destroy Microsoft. In fact,
the software that is going to destroy Microsoft is Windows Mobile.
[laughter]
But I’m getting ahead of the story again. What Microsoft did was they
decided they needed to copy the Netscape model in order to be
competitive. They reverse engineered the JavaScript engine and called
it JScript. They couldn’t call it JavaScript because Sun owned the
trademark, and they weren’t getting along very well with Sun at that
time, so they called it JScript. [...]
Most languages take years to develop – for example, Smalltalk was
eight years from Alan Kay’s first prototype to Smalltalk 80, when it
was first made available to the public. That’s a good timeframe for a
programming language, because you want to go through it and test it,
make sure that it works, and refine it in order to make sure that it’s
meeting its goals. JavaScript was prepared in about as many days. It’s
amazing that he could get it done and designed and working in such an
incredibly short time; in about two weeks. I challenge any language
designer – it’s sort of like a quickfire challenge. That turns out not
to be a good way to make software, but that’s how it was done, and
we’re now living with the consequences of that. Had Netscape been a
better managed company, they might have taken a lot more time, maybe a
couple of extra weeks, to clean it up, and we wouldn’t be dealing with
the bad parts that we have now. But we have.
The good news is that, for the most part, the bad parts can be
avoided. And if you avoid the bad parts, and if you work just with
what’s left over, the good parts, there’s actually a brilliant
language there.