Turns out, Java and JavaScript are not 'car' and 'carpet' --- ECMA-262 2025: 'ECMAScript syntax INTENTIONALLY resembles that of Java'

ChubakPDP11+TakeWithGrainOfSalt@programming.dev to Programming@programming.dev – -2 points –
tc39.es

I linked to the anchor where it says that, right to the bottom of the section 4.3. Will people just STOP saying JavaScript was 'never intended' to have 'nothing to do with Java'? They clearly meant JavaScript to be to Java what AWK is to C, at least syntax-wise. I was born one year after JS was conceived (the standard says 'invented', invented my ass! Who 'invents' a language?) so I am too young to have been around in the early days of web. But it seems like people back then wanted Java to be lingua franca of web, a bit like PostScript in the thread I posted a few hours ago. They named it JavaScript to assure people that it's the interpreted, scripting form of Java.

Now don't say 'JS and Java are like car and carpet' you will look like an idiot.

Also if you are wondering why I am reading the standard, it serves two purposes. First is, I wanna implement it one day in the future. Second is, I know shit about web scripting and I wanted to make myself a blog and I miserably failed. So I am learning it.

I know nobody asked, but one person might be wondering why someone would do this to himself.

11

JavaScript was created by Brendan Eich for the Netscape Browser. The job said to embed Java in the browser, but Eich was a Lisp guy and wished he could actually embed Scheme instead. Scheme is about as far as Java as one can get in terms of paradigm. Eich must have been stubborn because the result was JavaScript which is almost, but not quite, entirely unlike Java. Lulled by the seemingly familiar syntax, decades of coders have been baffled by the wild prototype-based object paradigm and the functional style hiding underneath.

JavaScript being somewhat like Java was an arbitrary constraint that was pushed by marketing and that was very partially honoured during implementation. The kinship between the two languages is slim at best. When explaining tech issues to the layperson, it’s important not to sweat the details and get to the point. Here the point is: JavaScript and Java are like car and carpet.

Also, chill. You have a lot to learn. We all do. Stop saying your colleagues look like idiots.

Would an experienced Java developer that has never touched JavaScript before know how to use JavaScript well enough to use it in a professional application without having to learn/revise a lot of things?

Would an experienced JavaScript developer that has never touched Java before know how to use Java well enough to use it in a professional application without having to learn/revise a lot of things?

No and No - They are like car and carpet. Unlike something like C and C++ or JavaScript and TypeScript that you can easily adapt to in a relatively small amount of time, Java and JavaScript serve completely different use cases and require significantly different skillsets.

Ugh I think the gap between c and c++ is wider than between java and Javascript, but admittedly I haven't done much of the latter two

Java and JavaScript are like car and carpet because despite the beginning of the names matching they serve different purposes. In the early web days Java applets were a thing and it failed which is why a new language was needed. It's not a secret that there was pressure to make Javascript look like Java, that's just not the point of the figure of speech.

If you actually knew how to program both Java and JavaScript (originally called Mocha btw), you would know that they are very different languages. Saying that JS was intended to have a similar syntax to Java is like saying Java was intended to have a similar syntax to C. They're both true, but it doesn't really mean anything.

Frankly one can learn any imperative language once one learns one. It's the standard library of a language and the quirks of the library that is the real challenge .The syntx of the language doesn't boggle anyone.

Who ‘invents’ a language?

Linguists or Developers.

They named it JavaScript to assure people that it’s the interpreted, scripting form of Java.

Who are they? There was that one guy who developed JavaScript, and he decided on the name of JavaScript, not ECMA.

Now don’t say ‘JS and Java are like car and carpet’ you will look like an idiot.

JS and Java are like car and carpet.

It wasn't even called JavaScript originally, it was called Mocha. It was then renamed to LiveScript before its original release. Then, Netscape wanted a licensing agreement with Sun to integrate Java into Navigator, and part of the agreement was to rename LiveScript to JavaScript with Sun holding the trademark for JavaScript. They also talked a lot about using JS to modify the properties and behaviors of Java applets in the 1995 press release, but that never really happened.

There was that one guy who developed JavaScript

Bullshit. AOL was a huge company with large development teams and lots of people worked on JavaScript. Obviously there was a project lead and in the beginning he did most of the work, but a project that big doesn't get done by one person and by the end he would have been doing less than 1% of the work.

he decided on the name of JavaScript

The legal teams at AOL and Sun Microsystems negotiated JavaScript as part of a deal where AOL would "only" pay millions of dollars per month to license Java as long as they didn't include any other programming languages in the browser. JavaScript wasn't a separate language, we promise.