News for hackers. Stuff that matters.
Re:The Reason Java Is Still Popular by adam_arthur on Thursday September 22, 2022 @02:56PM (#32943132)
Java can get the job done, but the language is certainly dated in a way that's impossible to fix without breaking changes.

Similar to C++ getting replaced by go and rust everywhere, Java's time has gone. It's just running on momentum at this point.

The JVM will likely continue on though

Re:The Reason Java Is Still Popular by qsort on Thursday September 22, 2022 @02:58PM (#32943157)
Java is still 95%+ of the marketshare of the JVM. Also "C++ being replaced by go and rust everywhere" is very much hyperbolic.

You are either wildly exaggerating or living in a bubble.

Re:The Reason Java Is Still Popular by adam_arthur on Thursday September 22, 2022 @03:00PM (#32943183)
C++ still exists because existing projects were written in it... that's it.

There's no value in using it for future projects other than a wider pool of developers to source from... a network effect that will diminish with time.

Java is objectively dated in so many ways, it's not really defensible to say otherwise. Tons of unnecessarily verbose and boilerplate aspects of the language.

Re:The Reason Java Is Still Popular by toxik on Thursday September 22, 2022 @03:05PM (#32943258)
That is a very bold claim from basically zero evidence, on both accounts but especially C++ being a zombie language.
Re:The Reason Java Is Still Popular by adam_arthur on Thursday September 22, 2022 @03:07PM (#32943277)
Ok, well then provide a counterclaim.

Ignoring network effects and existing libraries, which language feature of C++ makes it better than a Go or Rust for similar use cases? Which language features are more concise and easy to use? What objective traits of the language make it superior?

Re:The Reason Java Is Still Popular by scottLobster on Thursday September 22, 2022 @03:38PM (#32943670)
Ignoring network effects and existing libraries is a good way to make an irrelevant argument. It would be like requiring the Marine Corps to train in BJJ and Kickboxing because that works best in the Octagon. Great, but the Marine Corp doesn't fight in the Octagon.

In general, I'll take a somewhat mediocre tool where I can look up examples/libraries to do everything I need, with a large pool of competent developers to hire from, over an excellent tool that may or may not do everything I need at the level that I need, that relatively few people know how to use.

Of course, standards can change. But Go and Rust have a long way to go to build the network effects/libaries/ecosystem equivalent to that enjoyed by c++. I'll let the enthusiasts figure that out while I build things that get deployed, I look forward to the day it's ready, lot of promising features in those languages. Thanks in advance!

Re:The Reason Java Is Still Popular by adam_arthur on Thursday September 22, 2022 @04:10PM (#32944000)
Yes, so you're talking about network effect momentum.

In 20 years Java will not be the default choice for the vast majority of projects, just as C isn't now, despite being so in the 80s... it's obvious from the verbosity of the language. Network effect will fade over time.

Kotlin is already a drop in replacement for Java that is less verbose, more ergonomic and still compatible with the existing ecosystem. Why would anyone use Java over Kotlin on a greenfield project aside from prior familiarity? They wouldn't

Re:The Reason Java Is Still Popular by scottLobster on Thursday September 22, 2022 @04:50PM (#32944461)
Right, and if that momentum is going to last 20 years, then that's going to dictate what's a good strategic decision and what isn't for the next 20 years. Thanks for letting me know what the good options might be when my infant daughter is halfway through college, that doesn't help me save for it in the meantime.

Prior familiarity is a very good reason to pick an option for a greenfield project if you're operating on any type of serious budget (time or money), especially if you need to hire others to help out. There's also the annoying reality that most libraries for new/up-and-coming languages are simply inadequate, despite whatever claims they make.

For instance, one of my personal side projects involves getting familiar with WebAssembly (note: not on a serious budget), and I'm using emscripten to transcode because that's what the internet seemed to think was the closest thing to a standard toolkit. I found a bug simply by combining two pieces of example code from Emscripten's own documentation (you'll note I'm transcoding from c++ due to prior familiarity): https://github.com/emscripten-core/emscripten/issues/17143

This is not a dig on emscripten, merely pointing out that it's probably not mature enough for the stress of corporate-scale development, where you encounter all sorts of crazy edge cases well beyond the sample code. Java over the years has obtained that level of maturity. The edge cases are largely solved or at least known, and there's an army of experts and consultants ready to help if there's a problem. When time is money, that matters. It determines the risk profile of any project, greenfield or otherwise.

Java's momentum hasn't stopped, at best it's simply slowing. And at this rate it'll take decades to come to a stop, and decades more to recede to any meaningful degree. I'll also point out that C is very much alive and well in the embedded world. Plenty of job postings looking for C experience explicitly, for new products as well as legacy.

Re:The Reason Java Is Still Popular by pwinnski on Thursday September 22, 2022 @06:18PM (#32945358)
> Ignoring network effects and existing libraries

aka Ignoring the fact that it's easy to hire developers that already have widespread experience in C++, and ignoring the cumulative effort that thousands, if not millions of developers have put into writing and testing code that I don't have to... wait, why would I ignore both of those things?

If I'm creating software in a vacuum, such that I don't have to think about things like developer experience or time-to-market, then sure, let's say that Go or Rust is definitely better for many use cases. Very few people create software in a vacuum!

Re:The Reason Java Is Still Popular by TillE on Thursday September 22, 2022 @03:25PM (#32943506)
You started with "C++ getting replaced by go and rust everywhere" (an enormous exaggeration), and now you want to argue about languages features. OK.

C++ is in a state where it's good enough and slowly getting better. The enormous ecosystem, from libraries to game engines like Unreal, means it's not going anywhere for decades. New "greenfield" games are being written in C++ every day.

Re:The Reason Java Is Still Popular by adam_arthur on Thursday September 22, 2022 @03:59PM (#32943902)
"ecosystem" just like C before Java, yes. Not an argument
Re:The Reason Java Is Still Popular by AnimalMuppet on Thursday September 22, 2022 @03:27PM (#32943544)
> C++ still exists because existing projects were written in it... that's it.

False.

> There's no value in using it for future projects other than a wider pool of developers to source from

Well, you know, that is value. And there's value in being in the same language as the libraries you use. And there's value in C++ in the embedded space. And there's value to being able to control memory alignment in the high performance space. And...

If you're writing some generic web service, sure, there's no reason to write it in C++. Your statement was far too broad, though.

Re:The Reason Java Is Still Popular by qsort on Thursday September 22, 2022 @03:07PM (#32943279)
> C++ still exists because existing projects were written in it... that's it.

Obviously wrong, but sure, go on.

> Java is objectively dated in so many ways, it's not really defensible to say otherwise. Tons of unnecessarily verbose and boilerplate aspects of the language.

What Java are you talking about? It might have been true in the past, but modern versions of Java are just normal Algols. It's on par with C++, C# and Go, the other mainstream options you'd have for a project you'd write in Java. Sure, it's not as terse as Python, but neither is C++ or C# or Go.

Re:The Reason Java Is Still Popular by seer-zig on Thursday September 22, 2022 @03:25PM (#32943509)
Modern Java is much more terse than golang. No comparison really.
Re:The Reason Java Is Still Popular by vips7L on Thursday September 22, 2022 @03:20PM (#32943452)
Java the language is far more expressive than Go. Switch expressions, pattern matching, and streams are better than anything Go can offer right now.
Re:The Reason Java Is Still Popular by adam_arthur on Thursday September 22, 2022 @03:11PM (#32943339)
Ok, provide the counter evidence then.

Which aspects of C++ are superior to modern equivalents, ignoring ecosystem and network effects which aren't facets of the language.

Re:The Reason Java Is Still Popular by AnimalMuppet on Thursday September 22, 2022 @03:29PM (#32943559)
You made the claim. You should provide some evidence, not just demand that others do...
Re:The Reason Java Is Still Popular by adam_arthur on Thursday September 22, 2022 @04:00PM (#32943909)
Rust is more memory safe, more concise, and pretty much just as fast. There, now you go?
Re:The Reason Java Is Still Popular by AnimalMuppet on Thursday September 22, 2022 @04:15PM (#32944058)
>> C++ still exists because existing projects were written in it... that's it.

That was the claim. Between "Rust exists" and "the only reason C++ still exists is existing projects were written in it" there's still a fair amount of ground for you to cover.

You said that Rust is more memory safe. Hard to argue. And more concise, about which I have no information. Those are good things. But, as I brought up elsewhere in this thread:

Is Rust as easy to use in the embedded space? Is it available on as wide a variety of chips?

Does Rust make it as easy to control memory alignment, for those who need it?

Does Rust make it as easy to interface with libraries, many of which are written in C++?

Memory safety is good. Conciseness is good. Those are not the only reasons one might choose a language.

Re:The Reason Java Is Still Popular by kaba0 on Thursday September 22, 2022 @03:54PM (#32943842)
C++ is still the choice for truly performance-critical applications, period.
Re:The Reason Java Is Still Popular by adam_arthur on Thursday September 22, 2022 @04:14PM (#32944036)
Because of network effects, not because of the language itself. Thus dominance will fade over time.

There are many modern languages that are more ergonomic and just as fast.

Re:The Reason Java Is Still Popular by AnimalMuppet on Thursday September 22, 2022 @07:29PM (#32945987)
No, actually because of the language itself.

What matters most in high-performance computing? The algorithm, sure. What's in second place? Memory alignment.

Memory alignment determines whether or not I can use SIMD. It also determines how many cache misses I have.

Can I fight that battle using Rust? Maybe. Is it as convenient as in C++? Is any other language? as convenient as C++?

Re:The Reason Java Is Still Popular by steveklabnik on Thursday September 22, 2022 @07:50PM (#32946144)
Rust absolutely lets you control alignment, and use SIMD. I won’t claim to make a comparison to C++ here because I have never done that sort of work in it, but it is absolutely a thing.
Re:The Reason Java Is Still Popular by adam_arthur on Thursday September 22, 2022 @11:48PM (#32947810)
There are tons of modern languages that allow low level memory access, including Rust. Nobody chooses C++ due to it being more convenient than modern languages.
Re:The Reason Java Is Still Popular by PuppyTailWags on Thursday September 22, 2022 @03:02PM (#32943204)
I can't really see Java's time being gone for large, enterprise-level fintech/banking. Payments, integration with other large-scale systems, etc. Multiple payments or finance departments in FAANGs are still running Java, for example.
Re:The Reason Java Is Still Popular by adam_arthur on Thursday September 22, 2022 @03:04PM (#32943238)
You need to separate the language from the ecosystem. Yes, network effects will cause many languages to drag on in use, but that doesn't mean they're going to live in perpetuity.

COBOL was used for a long time for various business backends... did that mean it was a great language that was going to be used in perpetuity? no. And I assume the majority of those don't exist anymore, despite existing as recently as the 2010s

Re:The Reason Java Is Still Popular by PuppyTailWags on Thursday September 22, 2022 @03:06PM (#32943274)
I just think it's weird to say Java's time is gone when Java is still the language du jour in a major employment field of programming. Maybe Java's time is waning but I wouldn't call it gone. New payments/fintech startups and greenfield projects are still choosing Java. I don't know a significant field whose new companies are still going with COBOL from greenfield.

Additionally, what is replacing Java in the finance space? Genuinely asking, because I have no idea, and can you point me to some companies using the stuff that's replacing Java for banking/finance/etc?

Re:The Reason Java Is Still Popular by adam_arthur on Thursday September 22, 2022 @03:08PM (#32943306)
Yes, there was a time that C was used for pretty much every app. That time has come and gone as higher level languages became more popular.

So too will Java's. The language itself is objectively more verbose than many modern equivalents. Network effects and existing libraries aren't facets of the language and over time the gap will narrow

Re:The Reason Java Is Still Popular by kaba0 on Thursday September 22, 2022 @04:26PM (#32944197)
That assumes that that minuscule time being spent on writing 3 more characters+ is actually a productivity hit (it is not).

+ I am actually not sure whether even that is true. With how great intellij is, I would honestly wouldn’t be surprised if writing a java program would come out as less keystrokes than the equivalent program in a less verbose language.

Re:The Reason Java Is Still Popular by PuppyTailWags on Thursday September 22, 2022 @03:12PM (#32943352)
Can you please educate me on what are the languages and frameworks that enterprise-level finance and banking are going into in replace of Java? I'm good-faith asking.

Additionally, "the gap will narrow" is not the same as "Java's time is over", which is the only thing I'm having an issue with. Over implies that the gap is already closed, but I don't think it is, and if I'm wrong I sincerely want to know about what the new language du jour of a major employment field is.

Re:The Reason Java Is Still Popular by Gibbon1 on Thursday September 22, 2022 @04:28PM (#32944210)
If those guys are going to replace Java with anything it ain't going to be go or rust it'll be C#
Re:The Reason Java Is Still Popular by kaba0 on Friday September 23, 2022 @01:38AM (#32948444)
C never had the insane hype that Java once did - at the height of its popularity it had an insane amount of mindshare, and probably no language will achieve such ever again. It was literally the only PL that was/is known by laymen.

If anything, the field will fragment a bit more, but java likely never gonna die — cobol and fortran often run in VMs due to the hardware not being as long-lived as them, due to the JVM model, java is not even weak to that.

Re:The Reason Java Is Still Popular by ivanche on Friday September 23, 2022 @03:22AM (#32948958)
Don't forget that new release of Java is coming out every 6 months and that (almost) every one of them brings some core language improvement aimed at reducing verbosity. New long-term release is out every 2 years. How many C releases were there in the last 10 years?
Re:The Reason Java Is Still Popular by ithrow on Thursday September 22, 2022 @03:21PM (#32943463)
Many "modern" companies chose Java for the core of their backend servers, stripe, square, netflix to name a few.
Re:The Reason Java Is Still Popular by kaba0 on Thursday September 22, 2022 @03:53PM (#32943831)
C++ is definitely not replaced by Go, nor by Rust.

C++ as well, but especially Java likely has multiple times as much projects than all the smaller languages summed. They are ain’t going anywhere anytime soonz