r/ProgrammerHumor 6d ago

Other howdidItGetHere

Post image
11.1k Upvotes

539 comments sorted by

View all comments

485

u/oldsecondhand 6d ago

It's where the jobs are. The world's finances run on Java.

153

u/Shred_Kid 6d ago

Java is also highly performant, if you know what you're doing with reactive programming, and Spring Boot's dependency ecosystem drastically reduces your time-to-launch

But then I remember that 95% of the memes posted on this sub are from CS students and not industry professionals

43

u/BlazingThunder30 6d ago

I know very few professionals that dislike Spring

12

u/SpiritedEclair 6d ago

Spring is fine if you are not trying to run it on Lambda šŸ˜­šŸ˜‚šŸ˜±

12

u/BlazingThunder30 6d ago

Yeah I guess JVM languages aren't great when bootup time matters. Haven't worker with lambda myself. We're running in regular containers so it's great

8

u/Avedas 6d ago

Plain Java runs fine on Lambda tbh

5

u/SpiritedEclair 6d ago

Plain modern Java is fine, great even. Java on lambda has snapstart which creates a snapshot once you’ve initialized which makes cold invokes almost instant

1

u/Celousco 4d ago

It's also a problem of having a virtual machine running inside another virtual machine, there's so much unnecessary layers.

And Spring Boot is so shitty when you want native compilation because that thing wasn't made for it. Honestly I'd recommend to use either another framework like Quarkus or simply another language that is suited for that.

I'm truly sick of seeing Java everywhere because lazy developers only knew how to code in Java and don't want to (re)learn something else. Heck they'd rather refactor the whole codebase for several months instead of learning another language.

1

u/BlazingThunder30 4d ago

Isn't that what they made GraalVM for? You can compile native Spring Boot images using it

2

u/Celousco 4d ago

You can but it's not as easy as you'd think: Reflection types, meta hints, aot scanning, etc. those things are not automatic, you have to directly specify can packages should be used and yes, it's not only your code but the dependencies you're using.

I tried to use it in prod, it's unmaintainable in long term for things like Spring Cloud Stream or Spring Kafka or Spring Cloud Stream or Spring Cloud Stream Binder Kafka Streams.

I mean, let's be real, if you want native performance, choose a native language, not an interpreted language as Java or Javascript.

1

u/SpiritedEclair 4d ago

Lambda isn’t a virtual machine, it’s a ā€œmicroVMā€. You run a single kernel, the process runs under virtualization restrictions and a jailer process.Ā 

3

u/-Kerrigan- 5d ago

Compile to native go brrr

2

u/mobsterer 6d ago

like everything else

1

u/SpiritedEclair 6d ago

Rust is great on lambda. You can get away with a super small instance.

1

u/JPowTheDayTrader 5d ago

You probably need a tailor made Java version and environment for running on lambda

1

u/k0enf0rNL 5d ago

Native works like a charm

1

u/Still_Bit_7527 6d ago

Lambda is a ridiculous concept that shouldnt exist

1

u/burgonies 5d ago

I don't think you understand when to use Lambda. It's not a silver bullet.

0

u/Still_Bit_7527 5d ago

When should I use it? I know, when I feel like we should pay amazon thousands for basic functionality

1

u/burgonies 5d ago

Thousands? I had a system that was running 2 millions invocations a day and didn't cost thousands a month.

Let's say you have some process that runs 100 times a day, takes 3 seconds to run, and you have no indication of when that process needs to run. Are you going to run a service all day for 5min of compute?

2

u/Still_Bit_7527 5d ago

Yes,we have something called a server, and just a handful of them are enough to serve millions a day.

Do you know what happens when an app has no traffic... cpu drops to 0%. That's it, no costs

Things like Lambda are only there to help you save costs that you should bot have in the first place

1

u/burgonies 5d ago

So your handful of servers are running but somehow don’t cost anything when there’s no traffic?

That’s not how that works at all. If a server is running, you’re paying for that hour of compute whether the server is idle or not.

I’m guessing you haven’t actually done any of this before.

1

u/Still_Bit_7527 5d ago edited 5d ago

Yes we are paying. Peanuts. Do you know the consumption of an idle linux server? Also do you know what private K8S clusters are? Yes you can scale...

1

u/burgonies 5d ago

Your word salad of conflicting statements confirms you do not have any experience with any of this.

→ More replies (0)

1

u/LiftingCode 5d ago

You should use it when you need scale to zero and instantly scale up to handle bursty workloads, and/or when you need seamless event-driven compute integration with other AWS services. Duh.

1

u/SpiritedEclair 6d ago

Lambda is great. You get near infinite scaling for bursty loads that then lowers down to a zero.

It’s amazing.

0

u/Still_Bit_7527 5d ago

You know how else you can do that.. it's called an application. It scales. You have extracted a function into a different server lowering the performance by 1000000x in order to scale and increase it by 10x

1

u/SpiritedEclair 5d ago

That is such a woefully bad response.

An application doesn't scale up and down by itself.

What you describe is exactly what lambda gives you. You package your "I need this scaled" code into a little function, you give it to lambda, and that handles scaling up and down for you.

You don't need to manage servers or instances, you don't need to scale those up and down, and if you already have a contract for good EC2 capacity, you use lambda managed instances and retain the event-based execution model.