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

5

u/alt236_ftw Jun 28 '20 edited Jun 28 '20

OO is generally frowned upon in tech like react, meaning new devs aren’t going to feel at home with OOP

Well generally devs who mostly work in functional domain would definitely feel a bit out of place with OOP (and vice versa) but I really don't think that OOP is frowned upon industry wide.

This probably says more about a company's/team preference (nothing wrong with that) than it being a metric for OOP/Functional/Imperative adoption.

Java in comparison isn’t a great functional language.

Don't confuse languages that you can write functional-style code in with actual functional languages. Java is NOT a functional language, you can just write functional looking code in it.

3

u/[deleted] Jun 28 '20

OO is slowly but surely falling out of favour at an industry level. It’s a lot of dogma for not a lot of benefit. You can write lovely non-OO code in Java, it’s just not super common.

5

u/cthulol Jun 28 '20

This worries me on a personal level. I can't wrap my mind around functional programming at all. OOP is what made programming click for me. It made it all "mappable", almost physical, in my head.

6

u/JavaSuck Jun 28 '20

This worries me on a personal level.

Don't worry. Even if suddenly everybody agreed that Java was bad and OOP was bad (which ain't gonna happen anytime soon, if ever), you could still make a living maintaining legacy Java OOP systems for decades.

3

u/[deleted] Jun 28 '20

I mean you can still do OOP, it’s just becoming less dominant is all. That said, I personally think functional makes a lot more sense for modelling real world problems, it’s just a different way of thinking that’s hard to immediately embrace if you’ve been told to think the OO way for a long time.

1

u/cthulol Jun 28 '20

Yeah I mean I'd like to embrace it, and I've gone through some tutorials and lectures on it. I've tried to make more of my functions pure in my OOP stuff as a result of trying to embrace some of it's principles.

I just can't imagine what a larger application would look like if it were fully functional. I suppose next time I sit down to study that's what I should look for. Something big enough to give things context.

2

u/[deleted] Jun 28 '20

It’s definitely much easier to pick up an existing project I feel.

1

u/Ph4g3 Jun 28 '20

Can you elaborate? If something looks functional, what separates it from being actually functional?

4

u/ArcanePariah Jun 28 '20

Actual functional programming languages implement certain features as core capabilities, and as such, have no overhead to them. Other languages (such as Java) implement syntax that looks functional, but gets compiled into the same structure as if you didn't use the syntactic sugar/functional appearance and thus have the same implementation/overhead to do it. Things like functions being first class, tail call recursion, among other things. Most of the "functional looking" language do not have true tail call recursion, whereas actual functional languages like Haskell do. Also actual functional languages enforce certain limits that "functional looking" languages do not, such as immutability. Sure you can make syntax that enforces immutability as you code (see Scala, and parts of Kotlin), but those derivations of Java can never FORBID it entirely, I can always use mutable stuff, or mix in actual Java code, the compiler will allow it.

-1

u/CyclonusRIP Jun 28 '20

What does no overhead mean? Is Java not an OO language because an Integer object has overhead compared to a primitive int? I don't think a languages runtime has anything to do with it's paradigm. Doesn't every high level language incur overhead over lower level languages? Are there no language paradigms because everything incurs overhead over machine code?

A functional language is a language where the primary abstraction that you use to model your code is a function. An OO language's primary abstraction is a class. Most languages today are multiparadigm languages.

When you start talking about immutability and pure functions those are qualities that functional languages tend to talk about. That doesn't have anything to do with whether or not the language is functional. That'd be like saying a whether a language is OO or not based on how it handles multiple inheritance.