DEV Community

Role of Java in modern web development

Pavel PolΓ­vka on September 26, 2020

If you look at current tech Twitter, Reddit, etc.. Java gets an unreasonable amount of hate. All the discussion is about full-stack JavaScript deve...
Collapse
 
alekseiberezkin profile image
Aleksei Berezkin

Whether Java is slow or not depends on what to comparw it with πŸ˜€ Java is slower than C++ but, unless you write high frequency trading bot, it doesn't matter. Java is waaaay faster than JS; javac is faster than TS compiler β€” and that usually matters. That's why β€” yes, agreed, Java backend and JS frontend is very convenient and reasonable.

Collapse
 
alxgrk profile image
Alexander Girke

Totally agree with you. And when thinking a little further, I definitely hope Kotlin will be mature enough soon, to be able to write frontend and backend in the same language. :)

Collapse
 
zilti_500 profile image
Daniel Ziltener

You can use Clojure for that ;)

Thread Thread
 
alxgrk profile image
Alexander Girke

Clojure compiles to JavaScript? Didn't know that..

Thread Thread
 
zilti_500 profile image
Daniel Ziltener

It does indeed. You can even write code that is shared between both ClojureScript on the browser-side, and Clojure on the JVM server-side. Fulcro makes extensive use of that.

Collapse
 
siy profile image
Sergiy Yevtushenko

Kotlin already made so many mistakes in design that I don't believe it ever be a replacement for Java at backend.

Collapse
 
gcgbarbosa profile image
George C. G. Barbosa

I think the biggest advantage of Java is that it is around for years and there are tons of libraries written on it that are available on maven. That said, because it is an enterprise language, it requires retro compatibility and some mistakes made on Java 1.0 are still around on java 14 or whatever version they are at. If you wanna take advantage of the JVM infrastructure and libraries written in java you can also try languages like scala, that compiles to JVM and allows you to use Java libraries oob.

Collapse
 
siy profile image
Sergiy Yevtushenko

Java app will be very fast once you remove spring out of it. Just look at Techempower benchmark and notice that Java frameworks are among the fastest. But Spring not in this part, it resides among the slowest ones. And I completely disagree that this is irrelevant. Since majority of Java applications deployed in cloud, bad performance directly translates into higher expenses.

Collapse
 
kgilpin profile image
Kevin Gilpin

The job of server side languages is to glue the front end to the data store. It matters very little how fast of a language you use. What does it really do? Parse a JSON message, issue some SQL queries (with a LIMIT clause), correlate the result and generate some JSON. Then put it back on the wire. So you need a fast HTTP parser, fast JSON, and fast database driver. That’s about it.

Collapse
 
adam_cyclones profile image
Adam Crockett πŸŒ€

I nearly picked up jWebAssembly today as an excuse to learn java, I want to write a game perhaps. Anyway thanks for sharing.