DEV Community

Discussion on: Which language do you think has a better future: Java or Javascript?

Collapse
 
daleran profile image
Sean M Davis • Edited

It sounds like your professor gave the right answer.

Those languages are not mutually exclusive nor really against each other. Why not both? If you want to work as a web developer you will probably need to know several languages. You need JavaScript to do anything in the browser so if you are a web developer you will need to know it pretty well regardless of what the back end is.

Also, even on the backend Java and Node are really used for different things.

Node is great at I/O. It is also lightweight and quick to develop with. It sucks for anything that is going to be computationally expensive. Also, larger apps are harder to design well. JavaScript is pretty unopinionated so it gives you a lot of rope to hang yourself with. It is really designed to get a request, route it, and send back the response.

Java and its cousin C# are both enterprise-focused backend. Finance, healthcare, and government use it to build large enterprise-grade web apps. Java really excels at computationally heavy workloads that would make a Node server grind to a halt. It also is the quintessential object-oriented language. I would say Java's main alternatives are C# and maybe Go or Rust in the future.

PHP is also pretty prevalent so there is a decent chance you might end up working in it one day whether you want to or not. PHP actually isn't as bad as people say it is. It has a goofy inconsistent syntax but it is a capable backend. Don't learn it as your first language but don't rule it out later on down the line in your career.

JavaScript and Java are going to exist side by side for some time. They work differently and have a lot of different use cases.

I would say learn one of the popular languages and learn it well. Then move on to the next language. JavaScript is a must these days if you need to do browser work so I would learn it. Until web assembly is ubiquitous, JavaScript is a must. Then, try learning a backend language. I would try to pick a language with a different paradigm than you know. You will learn a lot more if you learn several paradigms (strictly typed, dynamic, imperative, declarative, functional, event-driven, object-oriented, etc).

Eventually, you will start to understand the underlying abstraction of programming and the language becomes just syntactic sugar.

Collapse
 
l222p profile image
l222p

Thanks for your answer!

This question came up in my mind because I had the opportunity to study and work in Europe. I noticied most companies look for Java developers, It was interesting for me because in my country is the opposite, most Javascript developer.

Collapse
 
daleran profile image
Sean M Davis • Edited

Big companies mean big enterprise projects and that means lots of Java jobs. Europe (and the US) both have lots of large enterprise companies. Pull up any job board in those countries and Java is probably the most demanded language by job title.