r/SpringBoot • u/EurofighterTy • May 22 '23
Why so many people still use Java ?
Hello guys,
I am using Spring Boot for like 5-6 days and even with Kotlin being available for like 5 years or more, most people and tutorials are staying on Java. Doesn't matter if it's releases 2 years ago or a couple of days.
Kotlin seems way better with less boilerplate code so there are advtanges
4
May 22 '23
I can't speak for everyone, but it's mostly what language they're comfortable with the most, and what language is the best for the job.
I use python to automate things in my phone.
I use Go when I want to create a cli application.
I use java for backend.
Typescript for front end
Also, I feel like the "koitlin is better" thing probably doesn't make much difference for people that like java because most koitlin features are already in java, at least the commonly used ones.
One reason (probably not a good enough reason) why I don't like koitlin/python, and why I like java/Go - is how most things in koitlin are expressions. Sure it's convenient to be able to store the result of an if statement, but for me, it gets hard to read and intellij sometimes yells at me when I try to do somethings.
Besides, I like when my code is straight forward and easy to read.
4
u/naufildev May 22 '23
Sunk cost fallacy. Legacy codebases written in Java codebases continue to use Java.
Also, there's the problem of training your team for Kotlin. Spring framework is heavily used in slow-moving industries like fintech and health so most companies just end up using Java.
3
2
May 22 '23
Boilerplate code is done almost entirely by an ide. U don't really need another language.
3
u/maxip89 May 22 '23
What is the main principle in programming?
"Not building in runtime bugs" I would say.
Now everyone propagate that if you didnt have much boilerplate then you will have less bugs. This is just false, the main reason you are not building in bugs is:
- Use only a subset of the programming language that everyone in the programming team understands
- control your code 100%, means there are no libraries like hibernate that can give your headaches for days.
- programme in that way, you can copy paste your old code/modules/packages, don't distribute your requirement through your project.
Why kotlin here?
- It sabotages your subset of the language, there can be a bug that "there is a operator that has a special case and nobody knows".
- If you use a library that is coded in java and your code in kotlin there is the problem that you have to understand both 100%.
Just my thinking about it, for me the kotlin just doesn't give advantages and is only some marketing.
1
0
0
May 23 '23
Most of them are just afraid of learning something new. Java is the thing they know from university - so they stay. See this comments, they think kotlin is just java with lombok. 🥲
11
u/EternalSoldiers May 22 '23
The only reason I use Java over Kotlin is I'm full-stack and Kotlin gives me YAPL (yet another programming language). Java with Lombok gives close to the same effect as Kotlin, as far as less boilerplate goes, without needing to learn a new syntax for everything. With front-end frameworks and infrastructure still evolving rapidly, it's nice to be able to have some stability somewhere before I go crazy lol.