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.

  •  macniel   ( @DmMacniel@feddit.de ) 
    link
    fedilink
    17
    edit-2
    4 months ago

    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.

  • 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.

      • You can take the contents of a C file, put it into a C++ file and there’s an 80% chance it will work without modification, and 15% of the incompatibility will be just sticking a type on your pointer instead of using void pointers (untyped pointers), or in newer code switching the restrict keyword for one of C++'s newer pointers.

        You can’t do that between JS and Java.

    • Douglas Crockford, author of “JavaScript: The Good Parts” has said:

      “JavaScript is the only language in the world that people think they write without learning it first.”

      I think this is a true statement (well, that and bash).

  • 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.

  • Oh they sure did. ES4 was going to very much be like Java, with static types and a fair bit of what TypeScript looks like today. We got very close to taking a completely different direction. It was ultimately doomed by IE among other things, which is ironic given Microsoft came up with TypeScript a decade later that does more or less the same thing as ES4 was meant to be. But it got scrapped and we got ES5 instead.

    https://evertpot.com/ecmascript-4-the-missing-version/

    • I used to use IE when I was like 12~13 — I think I switched to FF when I was 13.5 and never looked back. Just the tabs man. I use Pop_OS! these days and a few months ago I accedentally enabled tiling, then it I realized it has tabs. I am as happy as I were back then. Tabs are a concept that were thought of too late.

      btw this document mentions JScript. I don’t know WTF is that but when I google normal JS comes up.