Role of Java in modern web development

Pavel Polívka - Sep 26 '20 - - Dev Community

If you look at current tech Twitter, Reddit, etc.. Java gets an unreasonable amount of hate. All the discussion is about full-stack JavaScript developers. On the other side, you see people trying to get work as full stack javascript developers, but there are not enough jobs.

There are tons of Java and JS full-stack jobs. At all the companies I ever worked at we never had enough people. Sure Java is not at the backend of all the tech giants, sure Java is not the most popular language in your Twitter following but Java is the language that powers a lot of internet. Your online banking probably runs on Java, your favorite online magazine as well.

Java in full-stack

In the past, there were apps fully written in Java and it's related technologies. All the views are done in JSP, if there is Java Script it's probably jQuery forced into the JSP. There is heavy use of such monstrosities such as DWR remoting or any other framework that allows you to do stuff in java that is supposed to be done the other way.

And I will not lie, you will probably encounter some of these projects but the role of modern Java is to be a server-side api. Java frameworks are changing to support this. With Spring Boot it's incredibly easy to get started with database connections. With awesome state of the art support for tools like Solr, Elastic Search, etc.. it's incredibly easy to accomplish anything. With battle-tested language, that feels more and more modern. Thanks to it's new rapid release cycle.

But Java is slow

Yes if you take a traditional Java web app and run it through a bunch of benchmarks, it will probably be slower than the same code written in Go or whatnot. But you are not Google, almost nobody is Google so that you would need to care about nanoseconds. And if speed is your thing look at stuff like Quarkus it super fast and small. It's super suitable for AWS Lambda for example.

What about frontend

I'll give you that. Writing web frontend in Java is strange, I would say it's the same level of insanity as writing backend in JavaScript. For most of the projects, I worked on we chose Angular and TypeScript. We are generating a lot of code in our Angular project in Java. For each controller, we are automatically generating service and DTO classes. You create backend the same way you would do on any other project, and it automatically generated strongly typed classes for your frontend.

The end

Learning Java for web development in 2020 is definitely a huge advantage for you in the job market. Java/TypeScript full-stack is the best of both worlds and you cannot do wrong.


If you agree or disagree you can follow me on Twitter and reach out to me.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player