Java Vs JavaScript is something people outside of tech mix up all of the time and it is especially disconcerting as a developer to hear your prospective recruiter confuse these technologies since they are so different.

I surveyed developers about why they don't respond to recruiters, I'll give you a direct quote here:

Recruiters probably should have industry experience. There’s too much of a disconnect.

You can find rants all over the internet about people mixing up Java and JavaScript, so it makes sense to spend a little time putting this particular topic to rest.

I'm going to go into some depth to explain the Java and JavaScript ecosystems and it will be very full of Jargon and keywords so feel free to skip to the next section if your eyes start to glaze over! You might want to save some of these lists of terms though.

Why are they named the way they are?

Java was originally released by Sun Microsystems in 1995, and it was accompanied by a large marketing push and many collaborations. One of these was with Netscape. I am just going to quote this whole passage from WikiPedia which explains it (skip ahead if you want):

In 1995, Netscape Communications recruited Brendan Eich with the goal of embedding the Scheme programming language into its Netscape Navigator.[16] Before he could get started, Netscape Communications collaborated with Sun Microsystems to include Sun's more static programming language, Java, in Netscape Navigator so as to compete with Microsoft for user adoption of Web technologies and platforms.[17] Netscape Communications then decided that the scripting language they wanted to create would complement Java and should have a similar syntax, which excluded adopting other languages such as Perl, Python, TCL, or Scheme. To defend the idea of JavaScript against competing proposals, the company needed a prototype. Eich wrote one in 10 days, in May 1995

tl;dr: Essentially it was named similarly for marketing purposes. The languages are superficially similar with some syntax but underneath that they are architecturally disparate. JavaScript was meant to complement Java, but it is its own thing and is used in a different context.

Why is it bad to confuse them

It is bad to confuse the two because they are often employed in such fundamentally different ways (although this is less true than it once was).

JavaScript was made to run inside of web pages on the web browser, whereas Java was designed to be a general purpose programming language you could run on any machine and handle most tasks with.

So what does that mean in practice? Today Java is primarily used on the server side by backend developers (or Android developers). But JavaScript is most heavily used by front-end developers (although sometimes on the server side using Node.js). So the same developer will often not be interested in doing both of these things.

Some technical Terms

It's useful to know and understand these terms but most of them are outside of the scope of this small blog entry, I want to call them out anyway in case you want to do more research.

Java is statically typed, object oriented and multi-threaded.

JavaScript is dynamically typed, prototypal (although confusingly classes were added which is an OOP paradigm), and single threaded.

Just skip this if you don't care, but here is the list of terms and links if you want to read more:

Check back later, I will write a post explaining how most programming languages fall into these major categories and what that means.

Places where Java is used now

Most people have Java installed on their computers, and java is commonly used to write desktop applications. What is a desktop application? Something like Outlook or Microsoft word that runs directly on your computer (unlike JavaScript which runs in a browser).

Java is also heavily used to run web servers, for example when you visit a site like Google, Twitter, or Amazon, you are probably connecting to an application server running Java and the information coming back to your web browser passed through a server running Java at some point.

Java is also the language of Android. So every time you run an Android app, you are using Java.

Places where JavaScript is used now

JavaScript is used primarily in browsers, but browsers are everywhere. Even many mobile applications are a web browser in disguise running JavaScript (See Apache Cordova).

For recruiters it can be a little confusing to understand what technologies are based on JavaScript, but I will list a few here with a one sentence description just you can understand how many places JavaScript can be found:

React - a UI framework to build websites

- a UI framework to build websites Angular - ditto

- ditto Vue - ditto

- ditto React Native - write mobile apps using React

- write mobile apps using React Node.js - JavaScript on the server side

- JavaScript on the server side jQuery - a JavaScript library, hugely popular and getting pretty old now.

- a JavaScript library, hugely popular and getting pretty old now. JSON - a data interchange format based on JavaScript objects

- a data interchange format based on JavaScript objects TypeScript - a language that adds typing to JS, but compiles down to it.

So as you can see, all of these technologies with different names are all based on JavaScript. Ultimately, for example, to be a strong React or Angular developer, you have to be a strong JavaScript developer and understand the fundamentals of the language well.

Node.js Tooling, Libraries and Frameworks

JavaScript on the server using Node has only gotten more popular in recent years. Yes, I know I just said JavaScript was originally developed to run in the browser but Node.js was released in 2009 to enable programmers to write JavaScript as a server side application and it grew in popularity almost immediately.

So all of a sudden now, backend developers started to use Node to write application servers.

For recruiters I think it will be really helpful to explain a lot of these terms and shed some light how they evolved.

Again, skip these if you want. I will just give a one sentence description for each:

npm - the main node package manager (this where people publish re-usable code)

- the main node package manager (this where people publish re-usable code) ExpressJS - the first major backend server side framework for Node.js

- the first major backend server side framework for Node.js Meteor - a fullstack solution using Node on the backend

- a fullstack solution using Node on the backend NestJS - a newer Node server side framework gaining popularity

- a newer Node server side framework gaining popularity Hapi - another big server side framework

- another big server side framework Webpack - a build system used widely for building React applications

- a build system used widely for building React applications Gulp - a build system

- a build system Grunt - a build system

- a build system Babel - a language transpiler for javascript

- a language transpiler for javascript PM2 - a process manager for managing node server processes

- a process manager for managing node server processes Gatsby - a static side generator

- a static side generator Apollo - a graphql client and server

MEAN Stack

Soon after Node started to gain traction people became really excited about using JavaScript everywhere. You write your client-side code (the stuff that runs in the browser), you APIs, your server side code all in JavaScript, and to top if off your database could understand JSON.

MEAN stack is a specific set of technologies that accomplish this. Here is what it stands for:

M : mongoDB (stored data in JSON format)

: mongoDB (stored data in JSON format) E : ExpressJS - a server side Node.js REST server

: ExpressJS - a server side Node.js REST server A : AngularJS - a client side web framework

: AngularJS - a client side web framework N: NodeJs - means your server side code is JavaScript

So instead of having a language on the frontend, another language on the backend, and another data storage format, everything is all the same language. Now you could easily write a utility library (a re-usable chunk of code to do repetitive tasks) and use it both on the client and on the server. That is a big productivity win.

MEAN grew in popularity because you no longer had transform the data multiple times - just represent your data in JSON format - ship it to the server, and put that directly into the database without having to do additional data transformations like you would using a traditional RDBMS (relational database management system).

And of course when React came out, we got MERN stack, where the "R" stands for React.

Java Tooling a frameworks

Let's switch back to talking more about Java go into more depth.

Java is probably the most popular enterprise server side development language. Arguably PHP is the most popular server side language, if only because of WordPress, but many more significant programs are written in Java which is why I used the "enterprise" qualification. And if you look at many programming language popularity indexes Java is still number one or two.

One way to understand why this is the case is to explain the JVM: the Java Virtual Machine runs Java Bytecode and as long as you have a JVM for the computer you want to run the common Java Bytecode on you run your Java program. The flexibility and robustness of the JVM is a huge draw for the Java ecosystem.

Okay let me explain this another way:

Java is a language that compiles to Java Bytecode Other languages can also compile to Java Bytecode You must use a JVM to run the Java Bytecode A JVM can be made for almost any computer (phones, 32 bit processor, 64 bit processors, ARM chips)

So when you install Java on your computer, you are actually installing a JVM. Then you can run Java using this. You don't actually have to get the details here, but just know that the JVM underpins Java since people may talk to you about it. There is a whole industry of people that optimize, tune, and do monitoring and instrumentation for the JVM.

How about other JVM languages

Another reason Java / JVM has become popular is the amount of optimizations and work that have gone into the JVM. The Oracle JVM has had an enormous amount of optimization and research put into over the years to make it fast and safe. So people who may not like Java as a language have written other languages that compile to the common bytecode that the JVM runs.

Here are a couple of other JVM languages. You have probably seen these on resumes already:

Groovy - similar to Java but has dynamic types and functional paradigms

- similar to Java but has dynamic types and functional paradigms Clojure - a lisp for JVM

- a lisp for JVM Kotlin - developed by Jetbrains, is Google's preferred android development language

- developed by Jetbrains, is Google's preferred android development language Scala - a functional language, used to develop Kafka

- a functional language, used to develop Kafka Jython - JVM implementation of Python

- JVM implementation of Python JRuby - JVM implementation of Ruby

Some last remarks

So in summary, we talked about how JavaScript and Java are used for different purposes and they are different skills the same developer may not have. We also talked about how they are architecturally distinct. And finally I tried to go over some of the technologies and even languages they have spawned.

I also tried to drive home the point that JavaScript was only originally developed to be used in web browsers and it has only been in the last 10 years with the advent of Node.js that people are using JavaScript to do what was once traditionally server side work.

So hopefully if that was overwhelming I either left you with a thirst for more information (and you can come back and join me next time for more!), or I left you enough bread crumbs to keep researching on your own.