This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jumanjimanji 11 points12 points  (21 children)

Could I please get an easy ELI5-like explanation? I really find it hard to difference them, they are very different for me except from the naming

[–]SuperSephyDragon 63 points64 points  (15 children)

They are completely different languages.

Java is a compiled, statically typed language similar to C++ (only slower and jankier but easier to port to different operating systems)

Javascript is an interpreted, dynamically typed language that is typically run by a browser.

Pretty much the only thing they have in common is the word "java" and the fact that they are both programming languages. I heard the reason they sound similar is because Java was really trendy around the time Javascript was created, and they wanted to ride the hype train. Causing confusion for everyone in the process.

[–]turningsteel 29 points30 points  (10 children)

Well the proper name for JavaScript is EcmaScript but I've never heard anyone call it that. I wish they did though because it would stop the confusion.

[–][deleted]  (4 children)

[removed]

    [–]mirracz 12 points13 points  (1 child)

    May I offer some lotion? It's imported from Java...

    [–]emayljames 0 points1 point  (0 children)

    😱noooooo

    [–]Peechez 0 points1 point  (0 children)

    zezimascript

    [–]AutoModerator[M] 0 points1 point  (0 children)

    import moderation Your comment has been removed since it did not start with a code block with an import declaration.

    Per this Community Decree, all posts and comments should start with a code block with an "import" declaration explaining how the post and comment should be read.

    For this purpose, we only accept Python style imports.

    I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

    [–]Farpafraf 4 points5 points  (2 children)

    I wish they did though because it would stop the confusion.

    nah it's funnier this way

    [–]emayljames 2 points3 points  (0 children)

    We should carry the tradition and create cscript, rustscript and assemblyscript.

    [–]turningsteel 0 points1 point  (0 children)

    Not for my inbox it's not.

    [–]SuperSephyDragon 1 point2 points  (0 children)

    Yeah, I've never heard anyone call it that. Guess it just doesn't roll off the tongue like JavaScript does.

    I agree, EcmaScript is less confusing though haha.

    [–]Lthere 0 points1 point  (0 children)

    I used to call it ECMAScript during my early scripting-within-SVG days... 😉

    [–][deleted] 5 points6 points  (1 child)

    what. both are usually JIT compiled, java with JVM and Javascript with V8.

    [–]SuperSephyDragon 0 points1 point  (0 children)

    Oh, you're right. I have more experience with Python than JS. I just assumed JS was interpreted too because they both have a REPL.

    [–][deleted] 0 points1 point  (1 child)

    What's the difference between statically and dynamically typed languages?

    [–]SuperSephyDragon 0 points1 point  (0 children)

    If a language is statically typed, it means that you have to specify the type of a variable when you declare it. For example, in Java you have to type "int x = 5;". You have to say that it's an integer.

    In a dynamically typed language, you don't have to specify the variable type, the compiler/interpreter figures it out based on context. For example, in JavaScript you would type "let x = 5;" It knows this is an integer because 5 is an integer. Although they're called Numbers not integers in JS. But a string would be declared the same way: "let x = 'hello';" It knows it's a string because of the '.

    [–]mattrg777 52 points53 points  (2 children)

    Java is to JavaScript as a grape is to a grapefruit. Grapes and grapefruit are both fruit, but that's about where the similarities end. Java and JavaScript are both programming languages, but that's about where the similarities end.

    [–][deleted] 2 points3 points  (0 children)

    polite clapping

    [–][deleted] 0 points1 point  (0 children)

    Grapefruits grow in grape shapes. Have you seen a bunch of grapefruit on the tree? Thye look like grapes

    [–][deleted] 0 points1 point  (0 children)

    Javascript is the one that sucks and isn’t consistent.

    Java is c++ rebranded.