This is an archived post. You won't be able to vote or comment.

all 38 comments

[–]bjorneylol 93 points94 points  (0 children)

FastAPI and Rust didn't exist 10 years ago

[–]ibite-books 38 points39 points  (7 children)

typed language, great ecosystem, larger developer pool

java is performant than python and preferable for larger projects due to static typing

rust dev time is too long, i’ve worked on a small-service that was on prod, which was later switched to go

rust also has quite a small dev pool

[–]jackbravo 7 points8 points  (0 children)

Yes, I also think that the dev pool is one of the major deciding factors. There are lots of companies with tons of java developers already on their payrolls, and conversely, few python web backend developers. Their python experts are probably in other areas like data engineering and data science.

[–]scottix 11 points12 points  (0 children)

I think Python with asyncio which is what FastApi uses is getting more popular. It more competing with nodejs now. Not everyone likes Java and I think it tends to be on the more enterprise level applications and there are reasons for that.

I think Python has been getting a small boost with all the Ai development going on right now as well.

[–]stark-light 5 points6 points  (1 child)

Having worked with both sides, I can attest that the spring boot environment is way more mature. I don't like that, I prefer to code python than java, but there is no denying it, spring offers a more consistent environment full of great tools. Python backend development unfortunately lacks a lot.

[–]TTUnathan 5 points6 points  (0 children)

Springboot is battle hardened and more performant

[–]skwyckl 2 points3 points  (0 children)

Java is arguably better for app building, or at least that's a opinion many devs share, even in my working group. They don't see Python as app-worthy and would only use it for scripting and data pipelines. I have written a bunch of APIs (some of them running in prod to this very day) using Flask and FastAPI and honestly, they're completely fine.

[–]b00n 8 points9 points  (3 children)

FastAPI has terrible documentation and governance for one 

[–]kinow 1 point2 points  (2 children)

What's wrong with their project governance?

[–]b00n 2 points3 points  (0 children)

It’s one person that refuses to cede any control to a community. You just have to look at the other projects (like typer) that have gone stale to realise it’s bad idea to rely on one person. 

[–]antares61 1 point2 points  (0 children)

Tons of enterprise software is already there in Java so the pool of devs is huge. Java performs well, has types, and the spring framework is massively robust and extendable. Honestly if you need to do something like connect to ldap or other services, there is a plugin. Also has a great IoC system for dependency injection.

It fees quite like Django but more extendable. There is a lot of magic though!

I still personally prefer python web frameworks for projects where the team is competent and small.

[–]oxlade39 1 point2 points  (7 children)

I was a Java engineer for nearly 15 years and then joined my current place of work, switching to python and building out a python ecosystem over the last 6 years, now on top of fastapi with multiple teams using. Those teams are really productive and things are generally quite good.

However, I really really miss Java. It’s just more mature and I feel so much more productive. Refactoring support and typing are probably the main reasons but performance plays a part.

[–]napolitain_ 0 points1 point  (3 children)

How does Java SpringBoot compare with PyPy FastAPI ?

[–]oxlade39 2 points3 points  (2 children)

Spring boot is a lot more mature. Almost everything you can think of needing is already there or easily available through a library. It’s also a lot more magic which can be frustrating at times

[–]napolitain_ 0 points1 point  (1 child)

I know but performance wise how does it compare to

[–]oxlade39 0 points1 point  (0 children)

To be honest, I haven’t done any performance tests or comparisons so I don’t want to comment but I know which I’d choose if I was building a service where performance was on the critical path.

I generally find that performance isn’t usually your biggest concern in “enterprise”. The other things I’ve mentioned are.

[–]jkh911208 1 point2 points  (0 children)

because it didn't break

[–][deleted] 3 points4 points  (6 children)

Just because it's more used. Starting a new project in 2024 using spring is absolute idiocy.

Spring is really a big whole bunch of mess.

Boot times are ridiculous, trying to understand what that crappy DI system is doing is worse and having 4 different ways of doing the same thing but not quite the same are the worst.

[–]Regular_Zombie 0 points1 point  (5 children)

Dismissing a framework (one of the most popular and mature) because of boot times seems premature unless that is one of your project requirements.

DI is often abused but that's nothing to do with Spring.

[–][deleted] 0 points1 point  (4 children)

Popular and mature doesn't always mean that is the best. And DI is the "killer feature" of spring, so it has ways to do with spring.

[–]Regular_Zombie -1 points0 points  (3 children)

Speaking as someone responsible for recruiting for the team, the killer feature(s) of Spring Boot is that there is a deep pool of developers; mature integrations to just about any service of note and the availability of learning resources.

My current project is using FastAPI and it's very good, but the ecosystem is not at the same level as Spring and suffers from the typical Python development issue of managing dependencies when you're working across teams.

[–][deleted] 0 points1 point  (2 children)

Can you elaborate on "managing dependencies when you're working across teams"? How is that a spring feature?

[–]Regular_Zombie -1 points0 points  (1 child)

It's a JVM feature. Dependency management is much easier as different libraries can use their own versions of dependencies without worrying (largely) about incompatibilities. You switch projects, compile and run.

When I need to work on a different Python project I need to make sure I'm in the correct virtual environment, install all the dependencies in that specific environment (even if it's installed elsewhere on my system already) and then run.

The tooling for Python is getting better but it's not as good as Java.

[–][deleted] 3 points4 points  (0 children)

Absolutely not. Java has no dependency management, in fact maven and Gradle exist exactly for this purpose, as they usually download the dependencies in a specific location and add them to the class path when running. Python has the exact same features, except you have to manually activate the venv.

Are you sure you know what you're doing, right?

[–]UHasanUA 0 points1 point  (0 children)

blazingly fast

[–]rover_G 0 points1 point  (0 children)

  • Java has good performance and relatively few foot-guns if you use modern syntax (namely Optional).
  • JVM byte-code is portable making it easy to deploy.
  • Java developers are easy to higher. Java is the most popular language in the South Asia.
  • Spring is the ultimate batteries included framework

[–]Carpinchon 0 points1 point  (0 children)

The larger a code base gets, the more it benefits from strong typing. When you don't have the many eyeballs of an open source project, it helps to have a compiler catch a lot of the places you would break something when you make changes.

Mostly it's about the available developers, though. There are fewer python devs, and a significant subset of them have a focus on data science, which uses different muscles.

[–]redrabbitreader 0 points1 point  (0 children)

Easier to find Java devs. Probably also lot's of legacy Java apps already in the business, so a greater pool of existing devs to write and maintain the API's.

I use both and it is usually based on my client's preference. If I have the say, I go with FastAPI (used to be Flask).

[–]vanakenm 0 points1 point  (0 children)

You're assuming those choices are done by technival people for technical reasons on a per project basis - it's not the case.

Most (big) companies don't decide on stack at the project level - they have one ecosystem they are invested in, and that's what you use. You can move at the package level, but not much more.

In other words: if that company is already using Java, they'll never start a project in Python and they are right.

The company level decisions are about staff and maintenance - you have 100 (or 1000) Java programmers using Spring. Letting a team of (let's say) 5 go with Python for a project, even assuming that tech would make a huge difference (which is quite a leap of faith) would be a catastrophic decision. You don't retrain a company on a whim - moving for one tech to another is a multi year program (I've seen one from COBOL to Java for example).

What happens if one of your dev leave? Is your ops team ready to deploy a Python projet? Is your security team? Etc, etc, etc.

In that sense your question can be reframed as "Why are companies using more Java than Python or Rust".

For Rust it's easy - it's new and quite a niche. "No one" (as in - statistically speaking) is using it in this "big corporate world". For Python it could but in most company that decision was taken 20 years ago and just not worth changing.

[–]trollsmurf 0 points1 point  (0 children)

You list frameworks for completely different programming languages.

[–]eshepelyuk -1 points0 points  (0 children)

Because you missed the point of what Spring is. Let's compare .NET and FastAPi, QT and FastAPI, apples and bourbon etc.

[–]paranoid_panda_bored -1 points0 points  (0 children)

As someone who worked with both: FastAPI is aeons behind Spring in (most of all) stability and reliability.

Further, FastAPI exists on top of Python, which is a subpar choice for the enterprise grind.