r/learnjava • • 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!

0 Upvotes

86 comments sorted by

View all comments

10

u/Stack_Canary Dec 29 '23

Java is pretty fast these days. Fairly certain it outperforms C#

1

u/capm_diealone Dec 29 '23

Anything I can read about this? I’d love to see some numbers

3

u/Stack_Canary Dec 29 '23

https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/csharp.html

This compares different languages based on execution speed, binary size, memory usage etc. Seems C# has the general edge still, but for some type of algorithms java is faster.

Though, note that it's tricky to say language X is faster than language Y, as it depends on implementation and use cases. Even though C# may be faster in solving a fannkuch-redux problem, it doesn't mean that an API made in C# is faster than an API made in Java when you take into consideration DB operations, architecture, deployment and startup-times, architecture etc. Java has become very modernized in the last 10 years, and you see performance improvements for nearly every new version. The "myth" that java is slow comes from ancient versions of java way before version 8 and simply is not the case anymore.

6

u/capm_diealone Dec 29 '23

So in summary, I have nothing to lose by becoming as good at Java as I am at C#?

To be honest, most of my professors taught us algorithms and data structures in Java…C# wasn’t really a thing back then…I just always preferred C and C++. Even Python haha. But based on the responses I’ve received in this thread, I’m gonna learn Java. If it’s as modernized as you said, I have nothing to lose aside from my decades old prejudices.

Thanks Reddit! Stack_Canary specifically

1

u/Stack_Canary Dec 29 '23

No problem, you've asked a good question here. And to comment on your summary you're absolutely correct, Java is one of the most widely used backend languages, and it's not going anywhere anytime soon. It's performant and versatile, and has become less verbose and more shorthand than it was before. I would check out java 17 as it's the current LTS version.

Another note is that you can check out Kotlin as well, which is also a JVM language. You can even write Kotlin and Java interchangably in the same project. I personally prefer Kotlin, and if you're serious about entering the Java sphere it's worth checking out, as you'll see most JVM code bases using both.

And as a final note, you can check out the results of the stackoverflow survey for 2023 which gives a good overview of what's used and what's popular across all languages: https://survey.stackoverflow.co/2023/#most-popular-technologies-language-prof

3

u/capm_diealone Dec 29 '23

Oof, I don’t like that SQL is called a ‘programming language’…makes the survey seem dubious at best. But that aside, thanks! I don’t know how to add friends on Reddit (yes I’m a software engineer and I don’t know how to use Reddit) but let’s be friends. Cheers, dude! And when I say ‘dude’ it’s non gender specific, though statistically you’re probably a dude.

2

u/Stack_Canary Dec 29 '23

Well it's a developer survey, and considering a lot of developers use SQL, and the fact that there are DB-specialists, it makes sense to include it as a "language technology" so to speak, if they're trying to map what people are working with. It's a fairly renowned survey, one of the biggest of its kind :)

1

u/capm_diealone Dec 29 '23

Fair enough. But it’s not a programming language haha…I guess I’m fairly old school, despite being only 35 years old 😛

3

u/LTFGamut Dec 29 '23

Of course it's a programming language (a logical one). Why wouldn't it be?

-1

u/capm_diealone Dec 29 '23

I don’t have the mental capacity to dispute your assertion that SQL is a programming language, but it’s not even close to Turing-Complete

→ More replies (0)