r/programming • • Mar 07 '24

"Java is here to stay": Popular programming language to remain on business hit lists in 2024

https://www.itpro.com/software/development/java-is-here-to-stay-popular-programming-language-to-remain-on-business-hit-lists-in-2024
994 Upvotes

577 comments sorted by

View all comments

Show parent comments

46

u/addvilz Mar 07 '24

Last I checked, the overwhelming majority of AWS was also built using Java. The platform itself, I mean.

30

u/rjcarr Mar 07 '24

Most all major web services are run using java, from amazon to google to netflix to twitter to ibm, etc. It's actually more of an outlier to not be running java.

The big exceptions are facebook and wikipedia and probably a few others (like reddit).

14

u/Schmittfried Mar 07 '24

Because much of the current Internet was written during Java‘s peak.

8

u/Practical_Cattle_933 Mar 08 '24

And because it scales terribly well. Garbage collection is almost a necessity for often changing code, and in that category other runtimes are not even competitors. Like, literally every GC research happens on Java, it has multiple state-of-the-art GC implementations, meanwhile C# has.. a single file for its GC.

It’s not a bad thing of course, but it’s just a different tradeoff. Java’s GCs scale to terabytes of heap size, which may very well be necessary at that scale.

2

u/agustin689 Mar 08 '24

Does dotnet GC not scale to terabytes as well?

How does the fact that dotnet has struct and in general seems to need much less RAM compared to Java fit into this?

I would argue that dotnet hasn't had the need for such an advanced GC because it's much less wasteful in terms of RAM usage to begin with.

BTW, I've been hearing that java is going to implement value types since like 2015... and almost a decade later it still hasn't happened.

2

u/Practical_Cattle_933 Mar 08 '24

Well, C# can avoid memory allocation manually more easily than Java, but arguably that is a very specialized optimization and not the most common/idealogical way, so I’m not convinced that it would be using significantly less memory for comparable applications. The GCs can have different tradeoffs, and in general using more space means running the GC less often, so this is not an easy category to compare fairly.

Value types in java is said to be a topic “worth 7 phds combined” to implement. Yet they do actually have made good progress in the last couple of years, there actually is a development branch with working value types, that’s not the hard part. Committing to it with full backwards compatibility is.

1

u/agustin689 Mar 08 '24 edited Mar 08 '24

but arguably that is a very specialized optimization

I disagree. Every single application I've ever written, whether server side, desktop, mobile, or WASM, is fond of value types everywhere. From regular numbers to complex types representing immutable values, to even framework types such as Guid, DateTime, and even ValueTuples. Idiomatic C# is full of value types everywhere, which you might not even notice because they're used behind the scenes, such as var foo = (1,2); which is System.ValueTuple<int, int>.

Not to mention Span<T> and related features that while recent, are 100% performance-oriented and used extensively throughout framework code.

Yet they do actually have made good progress

Yeah, sorry. To me it doesn't look like that. It the last decade C# has had at least an order of magnitude more improvements than java. Many of them are sugar, but many are significant game-changers, such as async/await, LINQ, NRTs, etc.

2

u/Practical_Cattle_933 Mar 08 '24

Value types != manual control on where to/when to allocate. It has just as important semantic meaning as well, so yeah, it is very important and I’m looking forward to it in java.

As for C#’s improvements: none of them has remotely as big an effect as virtual threads in java will, and c# can’t even cleanly implement them due to their async feature. Also, some of their numerous features start to interact with each other in strange ways.

7

u/Birk Mar 07 '24

And all of Netflix. 2800 Java applications.

-7

u/epic_pork Mar 08 '24

That's a lot of apps to stream terrible movies

3

u/untetheredocelot Mar 08 '24

At that scale it's just how things go.

My team of 5 alone has 23 services we maintain and we'll never ever have a end user looking at it.

I kind of hate it but I understand why things are the way they are. Begrudgingly accept it.

13

u/bitspace Mar 07 '24

Yes, I think that's accurate. I know it was ~10 years ago, and I can't imagine it's changed much.

3

u/steveklabnik1 Mar 07 '24

There’s a lot of Rust in there these days. 

2

u/bitspace Mar 07 '24

Yeah, I know about bottlerocket. I assume there are other pockets too.

5

u/steveklabnik1 Mar 07 '24

Not just that, and not just pockets:

At AWS, Rust has quickly become critical to building infrastructure at scale. Firecracker is an open source virtualization technology that powers AWS Lambda and other serverless offerings. It launched publicly in 2018 as our first notable product implemented in Rust. We use Rust to deliver services such as Amazon Simple Storage Service (Amazon S3), Amazon Elastic Compute Cloud (Amazon EC2), Amazon CloudFront, and more. In 2020, we launched Bottlerocket, a Linux-based container operating system written in Rust, and our Amazon EC2 team uses Rust as the language of choice for new AWS Nitro System components, including sensitive applications, such as Nitro Enclaves.

https://aws.amazon.com/blogs/opensource/sustainability-with-rust/

Not saying the entire thing is, of course, just that it's quite a bunch.

2

u/EndiePosts Mar 07 '24

Do you know how many services there are in AWS? That’s a tiny fraction.