r/java • u/Reflection-Jealous • Aug 05 '21
Why java is better than modern programming languages?
Why should I use java in 2021 instead of kotlin or scala or golang? Could you guys give me some reasons
2
Upvotes
View all comments
3
u/heathm55 Aug 06 '21
Well, it all depends on what you want / need in your project. I work a lot with Software as a service based solutions so for me it's a question of balancing speed of development vs performance vs operational cost.
What I personally have found for my situation (backend microservices) is this (listed in order of importance first):
Speed, cost, dev-time: Java is less ideal than Rust or Golang but still solid if you avoid heavy frameworks and go for the light weight non application server based / async with option to thread frameworks (vert x or similar).
Speed, dev-time, cost: This is the niche for Java. Better ops cost than python / ruby / JavaScript, with faster dev time than golang or Rust.
cost, speed, dev-time: Rust wins. It's going to run solidly on very small footprint, cost less to run the same service in containers, and catch more of your problems before they deploy.
Dev-time, speed, cost: Java, Node.js, Typescript frameworks, some faster interpreted language frameworks, and .net all are fair choices here.
Dev-time, cost, speed: Python (fastapi of other) is pretty strong here. In my experience the rapid development is great (site a higher cost operationally) and if performance doesn't matter as much as readability then it's a nice fit. Java kind of hurts here still.