Lesson 2: Java vs JavaScript
The everyday picture
Car and carpet. Same first three letters, nothing else in common.
What it really is
- The similar name was a marketing choice in 1995, when Java was popular. The two were made by different people for different jobs.
- JavaScript runs in every browser and, through Node.js, on servers. It is the language of the web.
- Java runs on its own engine, the Java Virtual Machine (JVM). It is strict, labels every piece of data (a little like TypeScript, but built in), and is used heavily by banks, large companies, big back-office systems and many Android apps.
- They look a bit alike on the page, but they work very differently inside.
What it means for your idea
For a website or web app, you will almost certainly use JavaScript or TypeScript, not Java. Java matters if you join a large company that already uses it, or build certain kinds of large or Android systems. When someone says "I know Java", don't assume they can build your website, and the other way round.
Pick this when...
- JavaScript/TypeScript: websites, web apps, most startup products.
- Java: large company systems, some Android work, teams that already use it.
Quick check
A friend says "my website runs on Java because it has JavaScript". Right or wrong? Wrong. A website using JavaScript has nothing to do with Java.
Not covered by the 100 modules; it belongs in a specialisation.