This is different from other java scripts i've practiced on, which is the right way?!


#1

I have tried other java script practice sessions, even have used eclipse which is all geared towards java. But this practice session (which is "java script") is different. For instance, in the others that I've been learning, the main thing to used when you want to print out something is System.out.println("bla bla"); but on here they are using this console.log("bla bla"); why is it different and which is the one to use in the real world?


#2

At the root of it all, you're thinking about 2 different programming languages. The one you've used with Eclipse and where you print stuff out with System.out.println("something") is called Java.
The other one, where we use console.log("something") is called JavaScript.

Even though their names are very similar, they're 2 distinct, different languages. Usually JavaScript (the one you're currently learning on Codecademy (though they also have a Java course)) is used to build websites and is used mostly when building web applications. As for Java, you can think of it as this back-end behemoth that is used for (not exclusively) logic that runs on servers, not inside browsers.

Although all of those things are true in some sense, you should at least take out that Java and JavaScript are two different programming languages where each is used in a different manner, for different purposes and each is better at achieving different things. I can recommend reading a bit about both on their respective Wiki pages. JavaScript and Java.


#3

Hey, thanks for clearing that up for me shadowmar, your answer was very helpful.