+ 8

Java vs Javascript

Java vs Javascript which is better. Can someone tell me their clear differences

7th Jan 2017, 10:20 PM
Xperience
Xperience - avatar
2 Answers
+ 7
Nice one Manuel. A friend also pass this to me and i feel i should share it for those whom it will benefit. Should I learn Java or JavaScript? While they have similar names, they are totally different. It isn't like HTML, where learning HTML gives you the basic understanding of HTML5. I heard Java and Javascript have similar syntax and structure. They both have syntax based on C, but they are totally different. How so, aside from the length of the names? Javascript is designed to run in a browser. Java is an object oriented programming language that runs within the Java Virtual Machine. Which language should I learn? It depends on what you want to do. If you want to create webpages or apps that run through websites like some games, learn JavaScript. And when is Java a good idea? You'd use Java to create games and programs that don't rely on a browser to run. I heard the choice of language should depend on your personal style. JavaScript is more fluid, while Java is more rigid but better defined. But unless you use server-side Javascript, there's no cross-over between what the two languages can do. I wonder which one is more valuable in the marketplace. Knowing JavaScript means you'll be able to get some project immediately. Conversely, if you're going to be an app designer, learn Java. I thought jQuery has more job opportunities. Though I do know app designers make more money than web designers in general. JavaScript and jQuery are two sides of the same coin. Pity, since JavaScript at least has Java in its name. If you want Java and JavaScript at the same time, take classes on jQuery with a cup of coffee on the side. At least if I learn either language, I'll make more than the person serving me the coffee.
8th Jan 2017, 12:09 AM
Xperience
Xperience - avatar
+ 4
Well, which language better is depends on it't purpose or for which you will use it. But here are the main differences: Java is a statically typed language; JavaScript is dynamic. Java is class-based; JavaScript is prototype-based. Java constructors are special functions that can only be called at object creation; JavaScript "constructors" are just standard functions. Java requires all non-block statements to end with a semicolon; JavaScript inserts semicolons at the ends of certain lines. Java uses block-based scoping; JavaScript uses function-based scoping. Java has an implicit this scope for non-static methods, and implicit class scope; JavaScript has implicit global scope To sum it up: Java is used for desktop development and JavaScript is used for front end web.
7th Jan 2017, 10:25 PM
Manuel Wiltz
Manuel Wiltz - avatar