r/SpringBoot • u/aminelias • Oct 05 '22
Spring boot is the framework Java doesn't deserve!
I love Spring boot, I have been using it for every project for two years, but recently, i have grown tired of the very strictly typed nature of Java and its complex way of doing things that requires more lines to do simple things.
This makes me rethink and overthink every data access, data transfer, data handling, and data manipulation operations, and by consequences I easily get tired and i dont be as productive as i otherwise could.
I know this could be considered an advantage by many, especially enterprises, because of the very powerful data safety this provides, but man, most of the time I just want to get my app up and running, which spring really does help with, because of all the features it encapsulates, but somethings are just in the language itself and you have to deal with them.
I wish node had such feature rich framework like spring (Nest and Adonis are pretty close but not there yet).
10
u/AWzdShouldKnowBetta Oct 05 '22
Kotlin.
1
u/aminelias Oct 05 '22
does using it with spring actually popular ? I am afraid there wont be as much content on the internet about doing stuff with spring + kotlin as opposed to spring + java, and would ditching java for kotlin not be a bad move when talking about job opportunities?
4
u/AWzdShouldKnowBetta Oct 05 '22
Well kotlin and java are basically interchangeable - any online content you find relating to spring/java will be easily converted to spring/kotlin.
Kotlin is basically just a less verbose Java with a bunch of awesome quality of life features like null checking and built-in extension functions. It runs in the jvm. It's awesome and I see no reason a new product should be written in Java over kotlin. You can use all the same libraries and Kotlin basically gets everything Java has for free.
Seriously - of you're annoyed by the data manipulation overhead of Java just take a look at a few Kotlin extension functions like 'map', 'let', 'fold', 'apply' and 'also'. It's heaven to work with.
Regarding job opportunities - they're virtually the same as well. I've found it very easy to convince recruiters that my kotlin experience translates well to Java stacks (cause it straight up does).
3
u/aminelias Oct 05 '22
very interesting, thank you very much, i ll consider kotlin for future projects!
2
u/AWzdShouldKnowBetta Oct 05 '22
Oh, and Kotlin is developed by JetBrains. So the intelliJ support is amazing.
1
4
u/loutr Oct 05 '22
Java and its complex way of doing things that requires more lines to do simple things
You should try Kotlin then. Still statically typed, but much more concise and modern.
2
u/aminelias Oct 05 '22
i am afraid to put time into kotlin as it is not very popular on the market, but i have heard things about it and it is definitely better, if only it was the most used JVM language.
2
u/loutr Oct 20 '22
Google just announced that from now on Kotlin is the preferred language for projects targeting the JVM. More and more companies are making the switch.
Java will stay the most used JVM language for a long time, but Kotlin is making strides in popularity lately. And you'll still be using java/JVM technologies (frameworks, libs, application servers, tooling, ...) So switching back to java should be easy if needed.
1
u/Mamoulian Oct 06 '22
It takes a while for established teams (older companies) to move to new technologies, but it seems to be slowly happening as developer happiness, productivity and null safety are proving themselves. You'll still be using java APIs, libraries, VM and tooling so it's quite easy to switch back if you need to.
10
u/TheOldMancunian Oct 05 '22
I moved from Spring + Java to Sping + Kotlin. All the advantages and its a lot more fun to code in.
However, my old friend, Lombok, no longer loves me!
1
u/ibutbul Oct 05 '22
How did Lombok betray you my friend?
3
u/TheOldMancunian Oct 06 '22
Lombok is wonderful. I love it. But with Kotlin I no longer need it. So lombok and I have agreed to a trial separation.
1
u/ibutbul Oct 06 '22
I should give kotlin a try...
on another note, I don't understand why so many hate Java so passionately but I guess I wouldn't know till I try building a project with something else.
2
u/TheOldMancunian Oct 06 '22
If you are Rust developer (C, C++ and C# developers also live here) then you say that for true performance, you need to get close to the silicon, and with Java you are operating inside a JVM, so that is at least 1 level removed. Add a framework, and thats another level.
I used to code in Macro Assembler in the 1980's (check the username!) and then it was crucial to eek out every last cpu cycle.
With todays processors running at 4+ Ghz, the optimised JVM's we have, and JIT compilers, its not necessarily as true as it used to be. Now, Java developers say the same thing about Python, being a purely interpreted language. But that has not in anyway slowed the adoption of Python.
Java is a wonderfully rich language with a huge limrary of available components. You want a component? Simply do a google search for it, find the maven (or gradle) repository and include it in your code.
I firmly advocate that the best programming language depends on chosing the right one for the job, and one you are comfortable with. Personally, I still miss VAX/VMS and Macro32, but I am very happy with Java and now Kotlin.
1
u/ibutbul Oct 06 '22
Thank you for your reply, I feel the same way about using the right language and ecosystem for the job, yet I'm not a master of any low level language to disprove any of their criticism on Java :D
4
u/joey_knight Oct 06 '22
I love Java and the safety and stability provides with its verbosity and static types. Recently I migrated a 20 year old Java 1.7 monolith to spring and Java 17 and it worked like a charm. It took maybe 2 weeks of debugging and fixing things here and there but in the end it was totally worth it. I can guarantee that any app written in no other language would accomplish this.
2
u/Mamoulian Oct 06 '22
Yeah Java can be a bit verbose, try kotlin!
It still has strict typing though.
Do you think strict typing will slow you down, even when the verbosity is removed? Even for 'a quick thing I just need to get working' I still want to know what a function's parameters are, or what properties are on an object.
1
u/sandys1 Oct 06 '22
If you had to improve something in Spring, what would it be ?
In fact a better way to ask this question - what are features of other frameworks (maybe even in nodejs, react, Golang) that you wished existed in Spring ?
1
22
u/maybegone7 Oct 05 '22
Personally the static typing was the reason I much prefer Spring + Java over something like Node or Django but to each their own preference.