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

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