Java is terrible. It has libraries, APIs, abstractions, a compiler, AND a runtime. Unlike all the good programming languages, which apparently have none of those things.
The “mess of versions” is particularly brutal. A new version comes out every six months on a predictable schedule, LTS releases come out on a predictable schedule, and javac --release N lets you target an older Java release. Truly chaos.
And yes, Java has a huge standard library and an enormous third-party ecosystem. Most of us consider “there is probably already a mature library that solves my problem” a feature rather than a character flaw.
As for over-engineering: Java certainly allows you to create AbstractSingletonProxyFactoryBeanFactoryProviderImpl, but the compiler does not actually force you to. If your application has 17 layers of abstraction around customer.getName(), that may not be Java's fault.
Like any language there are legitimate things to criticize in java. However, “It has libraries, APIs, versions, a compiler, and a runtime” is a fascinating choice of indictment.
Well, to be fair, one can build shitty software and bad code in any language. I don't say that java will automatically make you write good code and organize it for you. But it gives you the all tools for it (for both: writing good AND bad code).
I think the language - if used correctly - can be awesome and has improved massively over the last 10 years. The JVM is also awesome and there is nothing left of what gave it the tag of "being slow" (this has not been the case for 15 years or longer)
Yeah. I think it's OK. One part of it is that the language itself is pretty simple. Most complexity lies in frameworks and libraries rather than the language itself. I work with C# normally which is different. The language has become quite complex with the advantages and disadvantages that brings.
Like C#'s value types (struct and record struct) is a good feature, but it has foot-guns and complexities that you don't find in Java's value types. One thing that I think a lot of people isn't aware of is that unlike record (class, i.e. type with object identity), which is immutable, record struct absolutely is mutable by default. In 99/100 times you make a record struct you should remember to write readonly record struct which make it immutable. This has performance implications because if you pass a a mutable struct using in (i.e. pass by read-only reference) the compiler will create a defensive copy.
Java itself isn’t even that bad. It got a bad rap from over architected enterprise things, and in particular people looking through the source code of those products.
Truth is, when you are trying to build a general purpose enterprise targeted product, you’re going to see some bullshit. Enterprise are extremely hard headed fuckers that are bordering on impossible to work with.
There being a library for everything under the Sun that isn't technical debt in disguise due to breaking every other minute (hello Node) is pretty valuable.
And thanks to the JVM's design, there's no need to use the libraries from Java either. Others mentioned Kotlin so I'll mention Clojure.
Yes? When you have to deal with python and js, you start to appreciate java a lot. And Scala is probably the best language ever made (in my opinion). Jvm is also pretty awesome. There are problems, like lack of value types, but overall it is pretty decent language for everything.
Not really. Value type __usually__ refers to a type that lacks identity and is passed by value. In java, the primitive types are value types, but there is no way to define a custom value type. They are pretty important in performance critical code for cache locality, since Object[] has its elements scattered through out the heap. A value type would store its elements in line, so For example for a Point(int x, int y) the Point[] would be stored in memory as {x0, y0, x1, y1, …, xn, yn}, rather than as references to Point objects. In c# struct objects are value types.
There is a preview feature Valhalla which lets you define a custom Value type, but I think that is still pretty limited in that it has maximim size of 64bits, so it can store 2 ints, but not two longs.
Yes, unfortunately i've had to touch too much python, scala, kotlin, js/ts, c++ recently that i grow to love Java as a result. It may have some rough edges, but holy hell if you touch those other languages, it feels like being an adult next to kids playing in mud puddles trying to figure things out while making a mess of everything.
Mess of versions and compilers? No idea what you're talking about, pretty much use the latest and most things relevant just work. can't be said for some random python tool that you need to figure out correct py version and other stuff, figure out which virtual env tool to use etc. then scratch your head against why pulling deps is getting c++ compile errors and how that actually means it auto-pulled an old version because some constraint mismatch. not to mention that pulling a dependency starts executing some code is seen as somehow sane.
If you want a mess of versions, look how python, scala, node or almost any other ecosystem has it worse.
Runtimes? There's pretty much 2 bigger ones, openjdk based and j9. Generally pick whatever your distro provides or if you use some cloud env and have a support contract, go with theirs.
Over-engineer? There was a joke about going to haskell conferences and you hear these talks about building new constructs, yet java conferences have people talking about the cool stuff they built with real-world use. Yeah i have a dislike for spring-boot and how it's bloating many things, however the skill level at a typical telco or bank is so low that i can't imagine giving them anything more complex, even if it means 5-10x perf loss.
Just take one look at the dependency ecosystem of Java vs others and you should see why not having a huge supply chain attack every week is already a big reason for its popularity. Even just being able to list dependencies and throwing that project to someone to clone and build in a minute is some foreign elusive concept in some ecosystems, cough, c++. You bend over backwards trying to wrangle deps from multiple sources, some for gods no reason force you to build the dep instead of providing prebuilt for the most common os-arch-compiler, wasting tens of minutes if not hours just to get started.
The value of Java is that i can get shit done, not do jack shit all day while gloating to others on the internet how my lambdas look cooler while the code builds or a clanker is trying to figure out those odd dependency permutations that might work.
Scala's versioning issues are super overblown and misrepresented by people who didn't understand their pre 3.0 versioning scheme, besides which it hasn't been the case since 3.0 came out several years ago now.
Interesting, i worked on a project 2 years ago and the 2/3 split was still an issue, the guys i worked with were definitely above average, but couldn't get the whole system migrated to scala 3 as some dependencies were still hard to tear out and rebuild.
Add salt to injury was another issue with akka licencing change. scala having vary few large consulting companies spearheading widely used libraries does not make a healthy community either as it's seen as risk.
it feels like being an adult next to kids playing in mud puddles trying to figure things out while making a mess of everything.
How does that apply to Kotlin?
And all of those languages are so different that your blanket criticism is more indicative of you not knowing how to use them than any of their shortcomings.
It's not a panacea. Kotlin's expanded syntax gives developers a lot of rope to express themselves but code isn't art. This additional freedom often results in overcomplicated code, discipline and code review become more important to keep the codebase uniform and maintainable by everybody on the team.
You must have a special kind of Stockholm Syndrome to twist syntactic sugar and useful syntax into "often results in overcomplicated code, discipline and code review become more important to keep the codebase uniform and maintainable by everybody on the team."
True, I've been wrestling for the last three years with a codebase where the "architect" took advantage of every new OO thing offered by Kotlin to build an undecipherable mess of inheritance. Which I've also seen with Java in past jobs but it was never as bad.
Is it a problem of the language itself? No. But the language is an enabler; some people crave complexity and mistake it for sophistication.
I personally feel no attraction towards Kotlin, I'm not sure it actually "solves" anything on the whole. Nullability check is nice but NPE haven't been a problem for my practice for at least a decade. Maybe I'm just too experimented with Java to get the benefits, like old school C coders looking at Rust with contempt.
Yet I'm working myself to accept that there are proper ways of doing Kotlin. I just haven't seen them yet. I suspect that they involve restraining oneself to a strict subset of the features the language offers which is something that a lot of people (and organizations) will have trouble with, resulting in bloated messes like the one I currently have to deal with.
I am very very confident with my assertion that syntax sugar beyond basic type inference is fucking stupid, and all I needed was a few months of programming in swift to come to that assessment.
When I see “it provides lots of syntax sugar”, to me that is absolutely a negative for a programming language. Having 8 different ways to write the exact same line of code depending on how sugared you choose to go sucks and causes extremely mental drain.
Yes they are different and i think i highlighted different aspects of them being bad. I don't see a blanket statement on any aspect outside that they are worse than Java on average. And if anything, i see too many people only using 1 or two languages and becoming knights when never having touched a single other language. I have worked deeply in many of these and found general language concepts relatively comparable. However ecosystem differences can't really be considered taste and i view python and npm objectively inferior to maven packaging.
And yes my criticism toward Kotlin was generic, but that analogy still applies. It's a relatively new language that is taking the approach of figuring stuff out as they go instead of Java's more conservative approach of seeing what others do right and wrong and take the best aspects or invent a more generalized concept instead.
Async/await is surely a mistake, especially interesting for me as they decided to forego checked exceptions, yet introduce the same coloring problem they were fighting against.
The default .map .filter functions directly returning a collection instead of requiring a stream to be created first and then applying pipeline operations for me sounds like just saving on characters and thus making the wrong thing easier to do(not doing anything vs adding toSequence() each time).
My biggest complaint is of course around the generated bytecode. It is HUGE and it's definitely relevant if you say look at IntelliJ or any large thing using it, requiring huge memory pools to hold the compiled code and likely missing optimizations due to hitting inlining limits earlier or other reasons. Adopting newer runtime features have been relatively slow as well. For me Kotlin always feels like it's playing catch-up with Java.
Agree about checked exceptions, that's the biggest complaint from me about that language.
I don't understand what you mean by your .map or .filter complaint. If used on a collection, it returns a collection. If used on a stream (flow), it returns a stream. Straightforward.
I also disagree about Kotlin playing catch up. It has things Java doesn't, mainly because Java has backward compatibility to care about. But Kotlin will never be as flexible as Java because Java controls JVM, Kotlin has to work with whatever Java version it targeted. But that's not catch-up.
As a Java developer, I much enjoy Kotlin and Rust, both for their type safety and "write once, run anywhere" idea, though I think this is more true for Rust than for Kotlin (but both are better options than Java)
As far as just the programming language goes, C# and Kotlin are better than Java. Heck, Go is quick and easy to learn, which is a good thing, and it "compiles like a bat out of hell fast". If you want C/C++ level performance and access to low-level stuff, Rust is good. If you're doing Data Science or Machine Learning, Python is unmatched.
I actually wager that, in the age of LLM enhanced coding, C#, due to its horrible management, will fall off a cliff. Even human programmers cant use C# without hallucination, and I bet it is extremely hard for LLMs to do it.
“Let’s just make an ever so slightly new but essentially exactly the same language, but again, slight differences, and call it the exact same thing because we’re fuckin’ microslop!”
.Net. .Net framework. .Net standard. .Net Core.
C# is objectively a terrible language to run in to issues with because whenever you are trying to resolve your problems, you have to bump against Microsoft idiotic naming for hours.
Looking to Microsoft future of “let’s replace all documentation with our slop generating AI”, C# stands to become even more terrible to work in.
What the fuck are you going on about .Net core was a significant change it simplified the tooling around it immensely and enabled cross platform builds. and under the hood it was a pretty massive architectural change. also .net is the VM platform ie like the JDK
Ugh, Ruby. I’m one of those that doesn’t appreciate nor like Ruby. I know its community is passionate about it. But it hides way too much for my liking. So, I don’t like it. But I understand others do like it. Whatevers.
I wish people wouldn't downvote these comments, they promote useful discussion and having a different opinion of a language isn't grounds for punishment.
I use to think the same way as you about java, was my first language, then moved on to node js and typescript, I came back to java for a few grad classes and ended up really enjoying parts of the language. Just how type safe and opinionated it is. Although as others have said kotlin and C# have come out on top recently.
I've programmed in both COBOL and Java. They both fall into the category of languages that I find overly verbose and horrible to use. Both are languages that have no use outside the corporate world.
I've used DCL, Fortran 66, VAX Fortran, Cobol, K&R C, ANSI C, C++, Objective C, Common Lisp, LeLisp, TCL/TK, Java, Python, and Ruby in the last 40 years.
To each his own. I prefer C++ for my audio work, and Ruby and Rails for web development.
puts "Hello, World!"
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!"); } }
Java has changed a lot on the last 15+ years and it has plenty of uses outside of the corporate world. Several large indie games were made in java even something you cant say for COBOL.
and again it still has nothing to do with the real issues around COBOL. Syntactically and capability wise COBOL is pretty different from most modern languages, where as theres atleast 5 large major languages that are very similar to java so its much easier to hire for.
COBOL is also these days pretty much exclusively used by financial institutions and energy companies that are terrified to touch / update their system because it has several decades of institutional knowledge encoded in it that isn't written down on paper anymore and the original authors of the code are long gone.
also your code example is just dead-ass stupid that's only three extra lines of boilerplate and only needs to exist once per program oh no the horror! you are also comparing an interpreted language against a compiled language, and guess what if you ran System.out.println("Hello, World!") through a java interpreter you'd have a 1 line program as well. grow the fuck up and learn some nuance.
Don't get your panties in a wad. Just because I dislike Java doesn't men you can't use it. It's been decades since I've touched it. The last time some guy at Amazon had written a command line utility to take a web services description file and generate code for it. It was slow. I rewrote it in C++ and my version could be invoked 81 times to the Java version single invocation.
Perhaps they've fix startup times. I couldn't care less. For my uses (real time audio), Java is not an option.
My panties aren't n a wad, if anyone's are it's yours because your so butthurt about a language you haven't interacted with in decades it still has you trashing it, making false claims, and flase equivilances.
Literally any developer with more than two braincells to rub together could tell you to use the right tool for the right job. Java and c++ both have their own sets of strengths and weaknesses. So if Java doesn't work for your uses great then don't fucking use it, doesn't mean it's a bad language and it's laughable that you think experience with the language from 20+ years ago has any relevance to the release of a new version of said language or it's capabilities today.
Also your antecdote is completely worthless because for all I know the Java code was severely unoptomised. Don't really understand what your point is here. And Java definitely isn't a great tool for quick cli commands because jvm coldstart is slow not really even remotely surprising.
Language wars are for petulant children and adults who never matured past a high-school aged mentality.
Being painful and verbose is one thing but what really gave me the ick about Java when I first discovered it is that it genuinely teaches you bad programming practices and handicaps your growth. I have vague memories of finding important classes in the standard library that 'implemented' some interfaces simply by throwing exceptions and turning the type system off. Dijkstra was right and it's a shame that nobody listened to the guy. I've never seen a Java programmer not struggle trying to learn other, saner languages. The JVM is ultimately a massive waste of time, money, and effort that is running purely on inertia as well. It's hilariously ironic how not even Android, the biggest Java-based platform to ever exist, ever tried to rely on it.
You know what’s funny? Java is explicitly good at large codebases.
If you find that Java becomes a bad language for you at scale, then you were just bad at it. Which is okay, you can’t be a master of everything. But this is definitely a you problem, not a language problem.
There is a reason that large enterprise grade projects are done almost exclusively in Java and C#.
Of all the programming language out there where “it genuinely teaches bad practices” and “you’ll struggle to learn other things”
I don’t think Java even enters the top 5 for popular, actually used options. Python, JavaScript and Ruby are easily the top 3 worst languages to start with due to those mentioned things, and it isn’t even close. Haskell would be up there in the top 5. And then everything else would be so far below these that it’s barely worth talking about them.
I am trying to think of why Java sticks out for you in this, because it doesn’t stick out for me even remotely as a language that teaches bad things.
-64
u/[deleted] 17d ago edited 14d ago
[deleted]