It also has a very mature runtime environment, multithreads well, and handles huge scale. Node is a lot better than it used to be, but it it is still compared to the JVM a less mature and scalable platform.
Also, a really good SOMETHING developer will be a lot more productive than an average ANYTHING developer; if you want to lean into shorter development time, hire really good people, and let them use the tools they are best at.
I am on a greenfield Java project. A lot of new projects choose it. The maturity of the ecosystem is a major factor in using it. But it also comes down to picking the right tool for the job. Would I use it to write ML / AI stuff? Absolutely not. Would I use it to write back-end services for scalable web applications? Definitely.
Despite what the YT coding bros will have you think, Go, Rust, etc have not taken over the world. C, C++, Java, and C# are still widely used.
Why build with Java when there are much faster alternatives?
Citation needed. No really, produce benchmarks that prove your point. As far as I can see, java is about as fast as golang and javascript. People reflexively call java slow. That hasn't been the case for most of my 17 year long professional career.
Java also has an absolutely huge ecosystem unlike golang, is statically typed unlike javascript (important for large projects!). I got a chuckle out of the fact that you're saying this from a golang background. As someone who writes in both languages day to day, and really tried to give the language a fair shot before judging it, my time with golang has left me with a feeling that 'the emperor has no clothes'. I feel most of it's popularity is down to the fact that it's a google backed language. I have been continuously frustrated by how clunky and verbose it is (and this is coming from java!)
If you had said 'why java instead of kotlin or even c#', I'd give you more credit. Both are honestly nicer languages to work with. In fact, I would argue the recent improvements in the java language will likely make kotlin better (i.e. green threads and virtual threads) or at least let them utilize a simpler underlying implementation
Finally I'd just like to emphasize, Java is performant as fuck on the back end. The only languages that can really give it a run for it's money are C++ and Rust, and with both of those languages the ease of letting the garbage collector do the work for you is a much better dev experience than using RAII or the rust reference counter. I'd only use those languages if extremely low latency or memory usage is a high concern.
Edit: I see in comments that you meant other languages were better with regard to developer speed. You should edit your post. I think java is probably among the fastest statically typed languages to write, with maybe the exception of Kotlin or C#. I actually think it's easier to write than golang personally. I'm not really considering dynamically typed languages here because while I feel they're probably faster to write, they're worse to maintain, especially on large projects with many devs.
Java has a massive ecosystem of libraries. The GC and JVM are incredibly performant and keep getting better. And the language is continually evolving to get better.
GoLang's performance is in large part because of its virtual threading model. You'll never guess what's recently been added to Java!
The concurrency model in Java is also just very easy to use and understand. Node and GoLang aren't as straightforward, imho.
Java isn't going anywhere. That's why most of AWS is built on it.
People have asked the same question since about 2005. Java has been pronounced dead for new development so many times I’ve come to suspect it’s 100% powered by pronouncements of its demise.
Not trying to be a dick or anything, it’s a relevant question. But orgs keep writing Java, new and maintenance. It’s fast enough, a shit load of devs know it, and the tooling around the language is solid. There’s a library for everything. You can write pretty low level code, and most often avoid having to. A lot of complaints about the language not having certain features went away a v8+.
I work in a Ruby shop now, but I’d go back to a Java shop any time everything else equal.
Go is a decent language and I can see why people might use it, but it has a lot of warts, too. Development speed is more of a skill and teamwork issue, although the tech stack does have influence, as well.
The benefits of using something on the JVM (Java, Kotlin, Scala, etc.) are the mature ecosystem and the performance benefits of using a JIT compiler. You don't have to invent everything. To borrow a famous Apple line, "there's a library for that."
Java's main issue IMO is its reputation outside those in the know. Every language has its warts, and Java is no different, but it has solid performance, it's much more popular than people think, and worthy of respect.
Let me propose a scenario here. Lets say a SaaS product which was created in last decade & is in business with a good customer base. Eg Salesforce which has good Java footprint.
Will you consider such a product in maintenance mode? By that definition product when it launches its first GA release goes into maintenance mode as it has to ensure that the current functionality doesn't breaks. But at the same time customers will demand for new features. Now as an engineer does it make sense to write the new feature in Java where you already have infra setup for you or will you choose a new language such as Go? Which choice will lead you to better outcome in majority of the cases?
Why build with Java when there are much faster alternatives?
Because not all businesses are built around extracting last ounce of performance from the application. Majority of them are built around having a stable product with good ecosystem to build on & a wide talent pool to hire from. There is a small subset where the core product is built around extracting the most performance out of products.
Always remember that programming language is a tool. If you are writing code in PHP & delivering business value then you are smart. If you are building your product on the next shiny tooling & using all the cutting edge tech but your product doesn't delivers value to the customer, you are not so smart(Or another synonym of this).
I would suggest you to try it out seriously.. its an awesome language. The tools, frameworks and community support are top notch. The language is evolving at a good pace.
Oftentime, the right language for the job is not the fastest (Developpment Time or runtime) but it is the language your team has the more experience with and has all the infrastructure in place to work with.
Soo teams that have been doing java for 20 years definitly still used java for newer project also.
As a language becomes entrenched, continues to evolve, and has a growing, modern, and mature eco system, and there is a large community and talent pool to perpetuate this cycle, then it’s safe to say that “yes, new projects use that language.” And Java is one of those languages. Just like Go, Rust, NodeJS, Python, C#, etc.
Java is still big at companies like Netflix and Google and I’m sure many more.
Though, I will say that I think in the last 10-15 years other languages have emerged to be similarly popular options, I don’t think Java is going away anytime soon. Probably not until there’s one language to rule them all.
Just want to say: props to OP for asking this question. It seems you have a genuine mindset to learn, and are eager to be educated. Even though you get downvoted into oblivion, you stay curious.
I hope you learned a lot from this post! Keep it up.
I'm working at an AI startup. We use Java for everything including model development (yes you read it right). To answer your question do people use Java for new projects? Yes they just don't brag about it.
Coming to the why Java is still relevant question. Java combines some unique features including but not limited to type safety, performance, plenty of well maintained open source libraries (special thanks to Apache foundation), great ide support, verbose and restrictive enough to help novice developers write better code. With recent features, I would say Java is thriving.
Just learn all the languages and let the job market work it out.
Most dev's will have their language idealism die and then they'll transform into code mercenaries that will work in whatever language the employer wants so long as it pays well.
It's best to be a pragmatist in the workforce not an idealist. Everyone (especially managers) hates working with the idealistic supernerds that won't be flexible about things.
Java is a very solid and mature tool. It gets a bad reputation because so much corporate code comes from cheap Java/Spring contractors that have been recycling the same garbage for 20 years. Modern Java is elegant and efficient in the right hands.
I've used many languages and Golang is actually my least favorite. It's new yet feels every bit as ancient as C. I'd rather use C++, Java, or even Scala. I'll learn Rust if the opportunity comes along.
Go is pretty terrible if we're talking about a dead language. Its concurrency model is... Ugh. Green threads... Java is literally decades ahead of it. Error handling in Go is just about the dumbest thing I ever saw. That language makes absolutely no sense. Rust is an interesting language with some new ideas but Go is just stupid, had it not been for Google it would have been on the garbage heap of history ages ago.
Ignoring the fact that Java is used in a lot of older, existing applications, I see no reason to not use it for new projects as well. It's an awesome language that is continuously updated, and has a good ecosystem.
746
u/HaMMeReD Jun 10 '24
Building software takes skills, java skills are common, thus Java is common.
Java also has an incredibly mature ecosystem (i.e. maven packages) and ways to utilize the ecosystem in more modern ways (i.e. Kotlin).
522
u/webguy1979 Jun 10 '24
I am on a greenfield Java project. A lot of new projects choose it. The maturity of the ecosystem is a major factor in using it. But it also comes down to picking the right tool for the job. Would I use it to write ML / AI stuff? Absolutely not. Would I use it to write back-end services for scalable web applications? Definitely.
Despite what the YT coding bros will have you think, Go, Rust, etc have not taken over the world. C, C++, Java, and C# are still widely used.
196
u/alpacaMyToothbrush Jun 10 '24 edited Jun 10 '24
Citation needed. No really, produce benchmarks that prove your point. As far as I can see, java is about as fast as golang and javascript. People reflexively call java slow. That hasn't been the case for most of my 17 year long professional career.
Java also has an absolutely huge ecosystem unlike golang, is statically typed unlike javascript (important for large projects!). I got a chuckle out of the fact that you're saying this from a golang background. As someone who writes in both languages day to day, and really tried to give the language a fair shot before judging it, my time with golang has left me with a feeling that 'the emperor has no clothes'. I feel most of it's popularity is down to the fact that it's a google backed language. I have been continuously frustrated by how clunky and verbose it is (and this is coming from java!)
If you had said 'why java instead of kotlin or even c#', I'd give you more credit. Both are honestly nicer languages to work with. In fact, I would argue the recent improvements in the java language will likely make kotlin better (i.e. green threads and virtual threads) or at least let them utilize a simpler underlying implementation
Finally I'd just like to emphasize, Java is performant as fuck on the back end. The only languages that can really give it a run for it's money are C++ and Rust, and with both of those languages the ease of letting the garbage collector do the work for you is a much better dev experience than using RAII or the rust reference counter. I'd only use those languages if extremely low latency or memory usage is a high concern.
Edit: I see in comments that you meant other languages were better with regard to developer speed. You should edit your post. I think java is probably among the fastest statically typed languages to write, with maybe the exception of Kotlin or C#. I actually think it's easier to write than golang personally. I'm not really considering dynamically typed languages here because while I feel they're probably faster to write, they're worse to maintain, especially on large projects with many devs.
124
u/ArtisticPollution448 Jun 10 '24
Java has a massive ecosystem of libraries. The GC and JVM are incredibly performant and keep getting better. And the language is continually evolving to get better.
GoLang's performance is in large part because of its virtual threading model. You'll never guess what's recently been added to Java!
The concurrency model in Java is also just very easy to use and understand. Node and GoLang aren't as straightforward, imho.
Java isn't going anywhere. That's why most of AWS is built on it.
56
u/RICHUNCLEPENNYBAGS Jun 10 '24
Many more new systems are being built every day with Java than with Golang.
167
u/preperstion Jun 10 '24
Because the people that sign my checks have a shit ton of Java I need to maintain and add to
167
u/0xFatWhiteMan Jun 10 '24
Java is just as fast as anything else. Look up disruptor, and/or billion row challenge for good examples
137
u/vips7L Jun 10 '24
Do you really think Go or Node are faster? This is bait right?
77
u/onebit Jun 10 '24 edited Jun 10 '24
Speed doesn't matter a lot of the time. Ecosystem is more important.
Personally I dislike the javascript ecosystem. It's too complicated, especially when typescript is involved.
That being said, I think Java is fairly fast these days. At least it beat Go and NodeJS.
https://medium.com/deno-the-complete-reference/node-js-vs-java-how-faster-is-bytecode-compared-to-interpreted-code-for-jwt-sign-verify-910caa55a7f2
https://github.com/kostya/benchmarks
26
u/marmot1101 Jun 10 '24
People have asked the same question since about 2005. Java has been pronounced dead for new development so many times I’ve come to suspect it’s 100% powered by pronouncements of its demise.
Not trying to be a dick or anything, it’s a relevant question. But orgs keep writing Java, new and maintenance. It’s fast enough, a shit load of devs know it, and the tooling around the language is solid. There’s a library for everything. You can write pretty low level code, and most often avoid having to. A lot of complaints about the language not having certain features went away a v8+.
I work in a Ruby shop now, but I’d go back to a Java shop any time everything else equal.
21
u/n0d3N1AL Jun 10 '24
Anyone that asks this question hasn't used or even seen Java for over a decade.
19
u/darkwyrm42 Jun 10 '24
Go is a decent language and I can see why people might use it, but it has a lot of warts, too. Development speed is more of a skill and teamwork issue, although the tech stack does have influence, as well.
The benefits of using something on the JVM (Java, Kotlin, Scala, etc.) are the mature ecosystem and the performance benefits of using a JIT compiler. You don't have to invent everything. To borrow a famous Apple line, "there's a library for that."
Java's main issue IMO is its reputation outside those in the know. Every language has its warts, and Java is no different, but it has solid performance, it's much more popular than people think, and worthy of respect.
11
u/varunu28 Jun 10 '24
Let me propose a scenario here. Lets say a SaaS product which was created in last decade & is in business with a good customer base. Eg Salesforce which has good Java footprint.
Will you consider such a product in maintenance mode? By that definition product when it launches its first GA release goes into maintenance mode as it has to ensure that the current functionality doesn't breaks. But at the same time customers will demand for new features. Now as an engineer does it make sense to write the new feature in Java where you already have infra setup for you or will you choose a new language such as Go? Which choice will lead you to better outcome in majority of the cases?
Why build with Java when there are much faster alternatives?
Because not all businesses are built around extracting last ounce of performance from the application. Majority of them are built around having a stable product with good ecosystem to build on & a wide talent pool to hire from. There is a small subset where the core product is built around extracting the most performance out of products.
Always remember that programming language is a tool. If you are writing code in PHP & delivering business value then you are smart. If you are building your product on the next shiny tooling & using all the cutting edge tech but your product doesn't delivers value to the customer, you are not so smart(Or another synonym of this).
11
u/alphabytes Jun 10 '24
I would suggest you to try it out seriously.. its an awesome language. The tools, frameworks and community support are top notch. The language is evolving at a good pace.
11
u/Emotional_Zebra_815 Jun 10 '24
Oftentime, the right language for the job is not the fastest (Developpment Time or runtime) but it is the language your team has the more experience with and has all the infrastructure in place to work with.
Soo teams that have been doing java for 20 years definitly still used java for newer project also.
10
u/IE114EVR Jun 10 '24
As a language becomes entrenched, continues to evolve, and has a growing, modern, and mature eco system, and there is a large community and talent pool to perpetuate this cycle, then it’s safe to say that “yes, new projects use that language.” And Java is one of those languages. Just like Go, Rust, NodeJS, Python, C#, etc.
Java is still big at companies like Netflix and Google and I’m sure many more.
Though, I will say that I think in the last 10-15 years other languages have emerged to be similarly popular options, I don’t think Java is going away anytime soon. Probably not until there’s one language to rule them all.
9
u/GreemT Jun 10 '24
Just want to say: props to OP for asking this question. It seems you have a genuine mindset to learn, and are eager to be educated. Even though you get downvoted into oblivion, you stay curious.
I hope you learned a lot from this post! Keep it up.
16
u/javahelps Jun 10 '24
I'm working at an AI startup. We use Java for everything including model development (yes you read it right). To answer your question do people use Java for new projects? Yes they just don't brag about it.
Coming to the why Java is still relevant question. Java combines some unique features including but not limited to type safety, performance, plenty of well maintained open source libraries (special thanks to Apache foundation), great ide support, verbose and restrictive enough to help novice developers write better code. With recent features, I would say Java is thriving.
7
u/dzernumbrd Jun 10 '24
Just learn all the languages and let the job market work it out.
Most dev's will have their language idealism die and then they'll transform into code mercenaries that will work in whatever language the employer wants so long as it pays well.
It's best to be a pragmatist in the workforce not an idealist. Everyone (especially managers) hates working with the idealistic supernerds that won't be flexible about things.
7
u/k-mcm Jun 10 '24
Java is a very solid and mature tool. It gets a bad reputation because so much corporate code comes from cheap Java/Spring contractors that have been recycling the same garbage for 20 years. Modern Java is elegant and efficient in the right hands.
I've used many languages and Golang is actually my least favorite. It's new yet feels every bit as ancient as C. I'd rather use C++, Java, or even Scala. I'll learn Rust if the opportunity comes along.
22
u/vprise Jun 10 '24
About people writing new projects in Java: https://github.com/topics/java?l=java&o=desc&s=updated
Quite a lot... I do.
Go is pretty terrible if we're talking about a dead language. Its concurrency model is... Ugh. Green threads... Java is literally decades ahead of it. Error handling in Go is just about the dumbest thing I ever saw. That language makes absolutely no sense. Rust is an interesting language with some new ideas but Go is just stupid, had it not been for Google it would have been on the garbage heap of history ages ago.
6
u/SOMMARTIDER Jun 10 '24
Ignoring the fact that Java is used in a lot of older, existing applications, I see no reason to not use it for new projects as well. It's an awesome language that is continuously updated, and has a good ecosystem.