r/learnjava • u/capm_diealone • Dec 29 '23
I don’t like Java. Change my mind.
Hi all! I don’t mean for this to be a shitpost or anything like that, truly. Lately, for some reason, posts from this sub have been entering my email. I’m primarily a C# dev, and I love Typescript as well. I’ve always hated Java. Don’t ask me why…I don’t know. When I was in school, I was more or less taught that Java is super slow because the JVM is bad.
I’d love to know what’s been up with Java, partly because a lot of banks seem to use it and partly because I don’t wanna be that guy that just discounts a whole language because of flaws it had over a decade ago.
So change my mind! I’d love to find out what’s been up with Java, and any resources y’all can provide for learning Java (bear in mind I’m a very experienced software engineer) that aren’t LinkedIn Learning (I get access through my local library but that access is down right now) would be super appreciated.
Again, this is not a shitpost. I just hate Java. Change my mind!
3
u/nekokattt Dec 29 '23 edited Dec 29 '23
it feels like you posted here with a message that sounded like
"i like c sharp, i know i am right because someone taught me this without explaining why but tell me i am wrong"
which basically is flame bait, as evidenced by the other comments here.
Perhaps reword your question to be diplomatic, or press the magic unsubscribe button at the base of the emails you are getting.
Regardless, my points as to why Java is a good language and platform to work with:
The JVM isn't slow. Maybe 30 years ago, but not now. You have JIT just like you do in C#.
Classloading is often considered superior to other mechanisms that rely on the host OS to load binaries into memory
Truely platform agnostic and able to interop into several languages (.NET can to a lesser extent)
Agent support is incredibly useful (see AWS XRay, AppDynamics, etc)
Much more vast range of libraries than C#
Backwards compatibility out of the box. Try running a C# app compiled with .NET 1 in .NET 8 out of the box.
JMX for monitoring out of the box.
Continuous stream of new features since Java 8 including:
modules
sealed classes and interfaces
switch expressions
virtual threads that allow blocking code to get the same benefits as async await
new FFI to side load native binaries without writing C++ bindings
vector APIs
HTTP clients in the standard library
record types
Limited but consistent language syntax features rather than developing for every paradigm that developers can think of, making it easier to maintain a consistent codebase.