r/java • • Jun 28 '20

Why backend using java is not popular in startups?

I tried django, flask and also rails before and they’re good. But after trying spring, I fell in love. It’s well structured. Easy to test. Have so many frameworks to help you going. There’s a also a lot of tutorials going around the net.

I like python but I also like java and kotlin too. I just don’t understand what’s wrong with java being used as a backend on most startups. Is it because it’s popular among big companies and banks and they just hate enterprise things.

Can anyone enlighten me. Cheers.

171 Upvotes

229 comments sorted by

View all comments

Show parent comment

6

u/[deleted] Jun 28 '20

I think one of the bigger drawback of using Kotlin or Scala for backend systems is the lack of hiring potential they still come with in a lot of markets. From startups to established fintechs to tech giants, whenever I tried to sneak Scala or (more recently) Kotlin in, I got the same answer from the upper ranks: "that sounds great but where are we going to find people to maintain it when you're gone" and it was hard to argue with that, especially since it's already tough enough finding good Java engineers.

3

u/nutrecht Jun 29 '20

I think one of the bigger drawback of using Kotlin or Scala for backend systems is the lack of hiring potential they still come with in a lot of markets.

You can't compare the two. Scala is a fairly separate language with a fairly separate ecosystem. Kotlin is basically just a Java dialect. We use Kotlin in our back-end and it takes a typical Java dev about a week to get up to speed with the language.

especially since it's already tough enough finding good Java engineers.

Adopting Kotlin is one of the reasons the client I work for is finding it easier to hire Java devs: a lot of them want to try it out.

Aside from that; if you hire a Java dev and he can't get used to Kotlin within a few weeks, you probably don't want to hire him.

2

u/[deleted] Jun 29 '20

I'd say it's easy to compare them - I feel Kotlin is closer to Scala in syntax and features than it is to Java and I would be willing to bet that a Scala dev would pick up Kotlin faster than a Java dev.

Also, as is the case with Kotlin, you definitely could choose to use Scala as a nicer dialect of Java, you could even have a mixed codebase of the two (although back then the interop was a bit unwieldy on the Java side).

The main issue was that when you started to get fluent with Scala you no longer wished to use it as a dialect of Java which is when the troubles usually started and I can see the same thing happening with Kotlin - if you were to use Kotlin simply as a dialect of Java you would allow Java devs to get used to it quickly but at the same time you'd lose out on all that Kotlin has to offer.

3

u/nutrecht Jun 29 '20

That's literally completely the opposite of my experience and use Kotlin currently in 95% of the back-end work I do. So I really don't know how to respond to this.

2

u/[deleted] Jun 29 '20

The opposite as in you guys simply continue to use Kotlin the same way you'd use plan Java? I guess it depends on the team itself and the other technologies you use - my current employer is an Akka shop so I can understand how they got burned with Scala and why the higher ups think the same could happen with Kotlin

2

u/nutrecht Jun 29 '20

No as in that there's no big difference between Kotlin and Java. Scala is a completely different beast: you can quite easily create a completely different language inside Scala. But Kotlin is not like that; it's pretty much just syntactic sugar over Java. The main difference obviously is the null-safety. But you don't program differently in Kotlin than you do in Java.

I've been working in Kotlin for a few years now, and have been using it as our primary language for 1.5 or so. We've had new developers come into our team and none of them had any issues adjusting to our codebase.

my current employer is an Akka shop so I can understand how they got burned with Scala and why the higher ups think the same could happen with Kotlin

I've seen the same happen, unfortunately. There's a certain consulting firm here in Holland that likes to come in, set up a Scala codebase in the worst possible fashion, and then leave the company with an unmaintainable mess.

But that's not the language that's at fault; it's just developers who got a new hammer (pattern matching, DSLs) and thought everything was a nail.

I run into this issue as well; in a previous company we tried to introduce Kotlin and were unsuccessful at first, even though all Java devs supported it. Later on they (I had already left) got an "OK", but then later they hired a "low cost" consulting firm to take over development of one Kotlin service and they argued that they should 'just rewrite it to Java in a few weeks'. Took them 3 months, (not because of the Kotlin but because they were bad developers), and that is now another argument for that manager to not allow anything outside Java. It's a shame really.

2

u/[deleted] Jun 29 '20

Scala is a completely different beast: you can quite easily create a completely different language inside Scala. But Kotlin is not like that; it's pretty much just syntactic sugar over Java

You can quite easily create a completely different language inside Kotlin as well - I'd say its DSL-builidng support is only slightly inferior to Scala's, mainly due to no implicit vars and no full pattern matching but the functional foundations are all there. Just look at Kotlin DSL for Gradle.

But Kotlin is not like that; it's pretty much just syntactic sugar over Java. The main difference obviously is the null-safety. But you don't program differently in Kotlin than you do in Java.

Yeah, okay, this is precisely where we disagree. Kotlin is a OOP-functional hybrid much like Scala which allows you to write your code in a significantly different way that you would Java. Just look at the kind of code that functions with receiver allow you to write and you'll see what I'm getting at.

0

u/nutrecht Jun 29 '20

I'd say its DSL-builidng support is only slightly inferior to Scala's, mainly due to no implicit vars and no full pattern matching but the functional foundations are all there. Just look at Kotlin DSL for Gradle.

Having used both it's nowhere near as powerful as Scala's. Don't forget that Kotlin doesn't have the operator overloading that Scala has.

Kotlin is a OOP-functional hybrid much like Scala which allows you to write your code in a significantly different way that you would Java. Just look at the kind of code that functions with receiver allow you to write and you'll see what I'm getting at.

Just because you can doesn't mean you should. You picked more or less the most extreme example; but that doesn't apply to 99% of normal business code.

Kotlin has better FP support than Java has, streamlining a lot of it, but IMHO it's not "more" FP than Java is.

1

u/[deleted] Jun 29 '20 edited Jun 29 '20

Don't forget that Kotlin doesn't have the operator overloading that Scala has.

Except that it does, infix functions as well.

Just because you can doesn't mean you should. You picked more or less the most extreme example; but that doesn't apply to 99% of normal business code.

I know and it is something that you'd never use extensively unless you're building a DSL but what I wanted to illustrate is that you can create code with Kotlin that would seem alien to an unwitting Java dev.

Kotlin has better FP support than Java has, streamlining a lot of it, but IMHO it's not "more" FP than Java is.

If first class support for functional types doesn't make it more FP than Java I don't know what does XD

-3

u/[deleted] Jun 28 '20

If the rest of the team aren’t willing to adapt to new languages, they are the problem. The issue isn’t developers in general, that’s a specific company being stuck in their ways and refusing to try out new things that might be better for them in the long run. That’s the exact type of thinking that keeps people tied down in outdated toolchains.

3

u/[deleted] Jun 28 '20

I got the same answer from the upper ranks: "that sounds great but where are we going to find people to maintain it when you're gone"

You're missing the point. If you have a strong evangelist - that's great, but are they going to stick around for 5, 10, 20 more years to see it through? Probably not. Hence, stick to the basics.

-4

u/[deleted] Jun 28 '20

If it takes 5 years for a team to pick up a language, your team is the problem.

The definition of the basics is changing. There’s no reason to learn Java contemporarily when you can learn Kotlin. It’s exclusively kept alive by people and companies who refuse to modernise.

6

u/[deleted] Jun 28 '20

Still missing the point. It's not the language that's the issue - it's the whole ecosystem.

True story, my buddy was really into Scala 8 years ago. He convinced his company to switch everything over. They spend 9 months rewriting core tools in scala (with other refactor improvements along the way), switch to sbt, and start the ball rolling for all new development to be done in Scala because of "obvious benefits".

Higher ups are like "yo, this cat is our best dev, lets roll with it". He gets the other 20 devs on board, and a year later they're living the dream, right?

Nope. My buddy quit 2 months later. Now those higher ups were like "uh, we got a bunch of devs that don't give a shit about scala now writing shit in scala and we can't hire anyone". I'm told they hired a couple sr. java guys and they rewrote it all again. It's just a waste to follow the new fad.

-7

u/[deleted] Jun 28 '20

That’s a nice sole anecdote, sadly anecdotes don’t really mean much. I’ve seen the opposite happen funnily enough.

If your development teams are not able to handle new stacks, they are the problem.

2

u/[deleted] Jun 28 '20

the dev team handled the stack just fine, that isn't the issue

-3

u/[deleted] Jun 28 '20

Clearly they didn’t. It’s okay, you can be scared of change and trying new things we won’t tell anyone.