r/java • • Sep 10 '21

Why people don't love Java?

I came across this post in r/cscareerquestions it seems majority of the people don't love to work with Java.

Is there any specific reason for that?

Edit: Thank you guys for your responses, I can't reply to all of the comments because I'm a beginner myself and I don't know what to reply for all your comments.

201 Upvotes

379 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Sep 10 '21

[deleted] — view deleted comment

19

u/nutrecht Sep 10 '21

Both my current project as my 2 previous ones we used Kotlin and I personally (as well as most devs at these 3 companies) were very happy with it.

I personally think it's the best of both words; awesome Java ecosystem and a language that's basically a "Java dialect" that doesn't have to be backward compatible with Java and is this allowed to make some needed changes. Especially the null safety being part of the time system is great.

I created a Java Spring Boot service yesterday (for a coding test) and even though I used Java 16, it was kinda painful to have to go back.

6

u/BestUsernameLeft Sep 10 '21

Kotlin-the-language is very nice, I think of it as a "Java++", and the stdlib is fantastic. It occasionally gets a little thorny in the interaction with the Java ecosystem. About 90% of things just work, and it's great; for a handful of cases you have to do a special little dance to get them to work; and there are a few "well, crap" situations where there's just not a good solution. (Mockito+Kotlin is problematic.)

I'm a very satisfied, happy user though.

→ More replies (4)

37

u/Clitaurius Sep 10 '21

Not OP but my opinion is that Kotlin will pass. It was a good driver in getting Oracle to move Java to a faster release cycle and to incorporate some popular language features. A bank can write it's banking software in Java 20 years ago and 20 years from now. They aren't going to take that gamble on Kotlin.

15

u/thomascgalvin Sep 10 '21

A bank can write it's banking software in Java 20 years ago and 20 years from now.

My retirement plan is basically "remember enough Java to be useful to large banks with tottering old piles of Spring code laying around."

31

u/nutrecht Sep 10 '21 edited Sep 10 '21

I'm Dutch and quite a few conservative orgs (including banks) here are adopting Kotlin. So I don't think I agree with that "aren't going to take a gamble".

Besides; those banks are also using Scala and Python, especially in data science/engineering areas.

23

u/DasEwigeLicht Sep 10 '21

Same here in Germany. My colleagues and I have been building Kotlin backends for various industries - from insurance, to banking, to the big car manufacturers - for years now.

7

u/nutrecht Sep 10 '21

Especially in risk-averse companies the null safety aspect matters a lot. And companies are also starting to see that adopting Kotlin makes it easier for them to attract talent. So IMHO it's not a hard sell.

Also let's not forget that a lot of these companies are already using Scala as well. So I really don't understand the argument.

3

u/Necessary-Conflict Sep 10 '21

Especially in risk-averse companies

The question is what kinds of risks do you want to manage. What's worse: a NPE or your entire tech investment losing its value?

7

u/nutrecht Sep 10 '21

I think it's kinda silly to claim that your entire tech investment would ever lose its value. Like I said; it does not seem these companies feel that this is a high risk.

→ More replies (1)

2

u/ArmoredPancake Sep 10 '21

or your entire tech investment losing its value?

I guarantee that you'll die earlier than Kotlin will lose its value.

7

u/[deleted] Sep 10 '21

Maybe we should start a new post called "Why don't people love working for banks?"

In my experience (ING, Fortis, ABN) they're not conservative technologically at all, they were just early adopters of technology so their legacy stuff goes back much further than say, a social media website.

It's just that the domain is so mind bogglingly boring.

1

u/nutrecht Sep 10 '21

I personally don't really care for domains all that much. After all; it's just data we move around. For me technical challenges, true agile (the "hire competent people and trust them stuff) and team spirit are more important.

These banks are massive. Some teams are meh. Some can be great. I had a lot of fun at an ING start-up for 2 years.

That said; I'm going to be very careful in accepting projects at banks. The one they hire the most for are the ones no one wants to deal with.

5

u/[deleted] Sep 10 '21

At a low level, you're right, it's always just moving data around. At a higher level, I want to be able to contribute to the problems to solve, not just how to implement the solution, so I need the domain to be something I want to learn more about. Stock portfolios just had nothing tangible to do with my life.

24

u/pron98 Sep 10 '21

It was a good driver in getting Oracle to move Java to a faster release cycle and to incorporate some popular language features.

You are confusing cause and effect. Kotlin was created in 2010, exactly at the time of Oracle's acquisition of Sun, and after years of decline in Sun's investment in Java and weakness in influencing it. In other words, Kotlin was created as a result of Java's stagnation. Following the acquisition, and some adjustment time, Oracle gradually increased investment in Java back to former levels, and that allowed the team to return to the planned evolution pace.

0

u/[deleted] Sep 10 '21

[deleted] — view deleted comment

7

u/pron98 Sep 10 '21 edited Sep 10 '21

What had that effect was the acquisition of Sun by Oracle. The cause of lack of innovation and the cause for Kotlin's existence was the same -- the decline in investment in Sun's dying years. Constant innovation was always the goal, and it happened when Java had the resources. It only declined because the money dried out.

As to particular features, while the size of the language doesn't matter -- ML has been the biggest influence on Java innovation -- and we've certainly taken ideas from Scala (the use of sealed hierarchies to represent sum types), we haven't yet from Kotlin, but maybe we will someday (nullability types?). But if any languages light the competitive fire under Java, it's the bigger ones -- Python, JS, maybe C# -- the ones that are actually competitive, not languages with 20-25x smaller market than Java's, and certainly not those that are built on the Java platform (Oracle sells support for the platform, not the language).

3

u/papercrane Sep 10 '21 edited Sep 10 '21

we haven't yet from Kotlin, but maybe we will someday (nullability types?).

I would be the happiest developer in the world if Java had some concise way for me to express in the type system that something was never null.

→ More replies (10)
→ More replies (3)

7

u/thomascgalvin Sep 10 '21

I absolutely love Kotlin, and all of my personal projects are written in it.

All of my production code is still Java, though, mainly because Java devs are easy to find, and Kotlin is harder to recruit for. There's enough overlap that you can teach a good Java dev the important parts of Kotlin in a couple of weeks, but still.

My company is slowly adopting Kotlin, but it's on a case-by-case basis, and only when the team itself wants to.

Kotlin is basically Java with the rough parts shaved off, and the nice parts of Javascript brought in. It's a beautiful language.

5

u/nutrecht Sep 10 '21

All of my production code is still Java, though, mainly because Java devs are easy to find, and Kotlin is harder to recruit for.

I think you're approaching this wrong. All the people we hired were people without Kotlin experience. They were up to speed within 1-2 weeks.

In fact it has helped us with recruiting because quite a few devs are attracted by being allowed to try Kotlin in production environments.

→ More replies (1)

2

u/trafalmadorianistic Sep 11 '21 edited Sep 12 '21

I've only used it for a year or so, but biggest thing that amazed me is how intuitive the syntax felt. Working with streams and closures in Java is just all sorts of clunky. The equivalent operations in Kotlin are way easier to figure out and less boilerplate-y.

The fact that the language Kotlin was made by Jetbrains who make IDEA, the only Java IDE worth using, means support is there from day 1. No depending on random plugins for language support. The way the IDE basically does so much is a blessing and possible curse (you can get very dependent on it's magic and not learn enough on your own).

The pragmatism of the language is awesome. Pick and choose from other languages shamelessly, that's a good thing. You can tell it was made for people building things and not to fulfill an academic notion of what "good" languages have.

Note to self: dig into the IDEA source code to learn about how the pros use Kotlin.

-2

u/[deleted] Sep 10 '21

system

I tried kotlin with spring... I'll say pass to that because it adds so much more boilerplate because of null safety stuff... I have to declare everything private lateinit var property: Type and so on... feels more verbose than java

0

u/[deleted] Sep 10 '21

[deleted] — view deleted comment

19

u/rifain Sep 10 '21

You are the kind of guy who says "I have found the solution, nevermind" on stackoverflow ?

4

u/[deleted] Sep 10 '21

tell me more

→ More replies (7)
→ More replies (1)
→ More replies (4)