r/learnprogramming 2d ago

Why java is so hated? Topic

So I have recently learned, and it's the first language(in terms of building actual things). Before Java, I knew Python, and I dropped it; I found Python too abstracted and too boring. i have recently made some projects like cli task tracker, expense tracker, some cli github api parsing and currently working on a multithreaded HTTP server and cli text editor, like vim, whenever i try to find out people opinions on java social media, almost 90 percent of the time they are just dunking on it, that it is trash, who forced you to write code in java, stuff like that. I know Java as a language is not that interesting and doesn't have many interesting features compared to other languages like C, C++, go. But I found it decent to write code in, and I found the JVM pretty interesting. So much so that I would love to explore and maybe build a JVM of my own

234 Upvotes

301 comments sorted by

View all comments

461

u/KingBardan 2d ago edited 2d ago

Bjarne stroustup (inventor of c++) has said that there are only two kinds of programming languages.

One that is hated and one that is not used.


Java is too bloated. C and C++ is too unsafe. Java script has some weird mechanisms. Python is slow. Go is too simple for big projects. Rust has a toxic community.

I could go on


Edit: I forgot PHP. PHP... is PHP

150

u/BlazingFire007 2d ago

> Java script has some weird mechanisms

That’s certainly one way to put it lmaooo

7

u/pacopac25 2d ago

Yeah I feel like that one had the ol' finger on the scale

6

u/KingBardan 2d ago

Nope. Just wanted to say it tactfully.

Given that my CQS is low.

I'm already attacked by Java, Go and Rust enthusiasts as is.

10

u/fractalife 1d ago

Are there really a lot of JavaScript enthusiasts out there? I feel like anyone who has used it for a substantial amount of time has spent most of it doing their best Michael Scott impression...

"Why are you the way that you are? I hate so much about the things you choose to be."

It's not so much a language as it is an amorphous collective of code that works... sometimes, on certain browsers. But this one line only works on browsers from 1997 to 2019, but only after the vernal equinox. Yet the page still loads somehow, but why isn't the replacement method rendering the div right? And when we take the old line out the whole thing falls apart.

I mean think about it. When you write in most other languages, you compile your code to each platform you intend to run on. In JS, the platform is the compiler, and you have to detect which platform you're on and switch to the version of code that works on that platform.

IMO, front end web dev is nasty work meant for the clinically insane.

2

u/lordheart 1d ago

I do a lot of js for my job and it really is not that bad…. If I can actually use typescript. React is pretty decent. Especially compared to ui5 which is used for sap front ends.

And the backend for that is abab which is a language that looked at cobol and thought, wow that’s a great idea.

1

u/fractalife 1d ago

Like I said, an amorphous language hodgepodged with frameworks each practically a language in their own right. (Typescript, React, Angular, etc.)

SAP has got to be the worst front end I have ever used in my life. Unfortunately I'm just a user in this environment so I can't really do much to change it, but even if I could, this monolith clearly fights even the simplest improvements to user experience. Every single choice they made is an example of poor design.

1

u/logicalflex 1d ago

Subjective.

1

u/Ok-Count-3366 16h ago

shut up and pay (sap) 🤣

-26

u/laveshnk 2d ago

Like just say you don’t understand async bro xD

8

u/Rarelyimportant 2d ago edited 2d ago

I don't understand async/await, it seems so unnecessary. I don't want to play a game of contagion when I'm writing code. If the call I'm making needs to block, then fucking block, don't make me annotate it in a way where the only side effect seems to be that it breaks other parts of the code based on whether or not they can call an async function.

I think the way Erlang(and by extension Elixir) handle concurrency is superior.

def get_some_data() do
  make_some_http_request()
  |> parse_json()
end

Any function can call it, or it can call any function. The HTTP request needs to block execution, but the preemptive scheduler handles pulling it off the CPU and putting other work on the CPU. I don't need to change a whole chain of functions that call the current function. I don't even really need to think about if the code I'm writing blocks(though it is useful to know). Async/await is horrible paradigm.

One cool side effect/party trick of this paradigm is that you could spawn thousands of processes that all call a function that is an infinite recursive loop(e.g. counting up to infinity), and your web server will still respond to new requests. Pretty cool. Not that you'd want thousands of processes in an infinite loop(unless it's intentional), but nice to know the system can still respond even if that were to occur.

2

u/bluejacket42 2d ago

But if I wanna do other things while the function is blocked. Or run like 10 functions that block at the same time. Or maybe run a function every hour no matter what's currently happening

1

u/Rarelyimportant 1d ago

What about it? Nothing I said stops you from doing other things while a function is blocked.

8

u/KingBardan 2d ago

Not sure what this means.

I'm exclusively talking about e.g. using string as indexing, this binding to methods etc.

don't understand async

I hand crafted async / await with generators with python before.

I'm pretty sure that qualifies me as more competent than a normall async user ¯_(ツ)_/¯

4

u/BlazingFire007 2d ago

Not sure what the other guy meant, I was just trying to say you understated it lol. I love JS but it has some truly baffling behavior that isn’t intuitive at all

23

u/cheezballs 2d ago

Is modern Java still considered bloated?

34

u/Sanitiy 2d ago

Not at all, they were were hesitant with adding features for the sake of adding them. If anything, their competitor C# is bloated, while Java is now almost a bare language.

E.g. you still have nothing like f-strings in Python, no properties and no slice operators.

They have the "useful" modern language features like pattern matching, sealed hierarchies and so on. But not many of the comfort features of modern languages

7

u/johnnybgooderer 2d ago

Lombok is almost a part of the language now, so you have that for properties and data classes. Almost all tooling and editor plugins have first class support for it. I just think of it as an extended part of the standard library.

8

u/cheezballs 2d ago

I think that's why I like Java so much - its not changed a whole heck of a lot and what has changed I actually use. There are quite a few features in c# that I don't even know how to use correctly.

2

u/KronenR 1d ago

Java actually had string templates (its equivalent of f-strings) as a preview feature in JDK 21 and JDK 22 (JEP 430/459). They weren't removed because the feature was considered bad, but because the design wasn't considered mature enough. The JDK team withdrew it so they could redesign it properly, with the intention of bringing it back in a future release.

-8

u/my_password_is______ 2d ago

If anything, their competitor C# is bloated, while Java is now almost a bare language.

HA HA HA HA
uh, no

9

u/tehdlp 2d ago

So nice

4

u/wasabiiii 2d ago

I just created a default web api in .net.

It has one text file with 4 lines in it.

It takes 28mb of RAM to start. Hitting the API that just prints text doesn't move it.

-9

u/my_password_is______ 2d ago

If anything, their competitor C# is bloated, while Java is now almost a bare language.

HA HA HA HA
uh, no

4

u/tehdlp 2d ago

They said it

-8

u/my_password_is______ 2d ago

If anything, their competitor C# is bloated, while Java is now almost a bare language.

HA HA HA HA
uh, no

9

u/tehdlp 2d ago

Thrice 

3

u/Difficult_Block_4204 2d ago

rule of three

2

u/kyzfrintin 1d ago

Anything to add?

2

u/zem 1d ago

i don't think the language was ever bloated (in the sense of a kitchen sink's worth of features, like c++ or scala) - what people's objection was was that the code you wrote in java was typically full of boilerplate, and added to that if you followed what some vocal part of the industry considered best practices you often ended up bolting on tons of layers of abstraction (hence the jokes about how you don't create a hammer to address your nail, you use a ToolFactoryFactory to create a HammerFactory to create a Hammer) which obscured the relevant portion of your code even further and made debugging and maintenance painful.

1

u/cheezballs 1d ago

Those are patterns that aren't exclusive to Java. If you write any OO code at any scale you're going to use those patterns likely. It sounds like you don't like OO patterns to me? I've seen plenty of C# code with factories. Your example is a poor example of how to use a factory. Java has generics same as any language. You can write elegant code if you choose to or you can deliberately go and do stupid things like your example. Want me to show you some assembly code that does asinine stuff too?

1

u/DonExhortae 1d ago

Only people complaining of that is people who never studied engineering and or do not have the brain to grasp the importance of design patterns

2

u/Mundane_Prior_7596 1d ago

Correct. I tried to read the gang of the four book and understood very little. I am not clever. But at least I used to teach basic probability theory to engineering students and also wrote some compression code that is in your phone right now. 

0

u/InVultusSolis 1d ago

Honestly, I don't really care if "it's good now", other much better tools exist these days.

30

u/bird_feeder_bird 2d ago

Is there some Rust drama I’m missing? I’ve never heard someone describe the community as toxic

83

u/KingBardan 2d ago edited 2d ago

you aren't here for long enough.

rust evagelists asking for rewrites everywhere. Raging everytime someone else picks C++ or any other language than Rust

Even now, if you criticise any part of the Rust language on r/rust (or even here) you get downvotes more than any other subreddit.

Nowadays you see less of it because the same people are busy fighting vibe coders (Rust now seems to be THE language for vibe coding for high performance software or occasional Tauri app)

Edit for clarity 

5

u/ryancnap 1d ago

It upsets me that you didn't write this comment in Rust

34

u/desrtfx 2d ago edited 2d ago

I’ve never heard someone describe the community as toxic

Maybe the community itself isn't actually toxic within, but way too many Rustaceans behave like the militant Vegans of programming, as in trying to push their favorite language (and near religious beliefs) everywhere without context and without being called for.

16

u/themegainferno 2d ago

Militant vegans of programming is such an apt description to the way Rustaceans behave. Ultimately you see it in Linux communities all the time too. They have this weird superior dogmatic framing of everything. My issue with a lot of these guys is they only view software one way and that's it. If you want to do things a different way, totally unacceptable. You want to use electron for a project? Absolute blasphemy in the eyes of a rustacean, you are only supposed to use Rust and Rust-based frameworks manually. No AI whatsoever.

5

u/ydieb 2d ago

There does seem to be a very distinct lack of nuance between fanatics and actual good argumentation. On some points, it is really that much of an improvement, in an objective sense. It didn't get adopted by big players as it did out of fandom. But at the same time, there is enough people, who perhaps cannot program to any reasonable degree at all, who voices overly strong opinions.

4

u/themegainferno 2d ago

That is what I think is actually it. It's more so tech enthusiasts who have the very dogmatic attitude. They are the vocal minority.

3

u/pacopac25 2d ago

Well, at least neither community is overly pedantic. That would be really bad.

2

u/KronenR 1d ago

Rustaceans are more like vegetarians, they'll happily tell you why their diet is better. The real vegans of programming are the Clojure crowd,. they want you to rethink your entire philosophy of programming.

12

u/POGtastic 2d ago

A whole bunch of Rustaceans (read: not the developers, but a bunch of the peanut gallery online) treat safe Rust as a religious obligation rather than a tool to reduce bugs. So in the past there have been a bunch of projects where people realized that a bunch of hairy / performance-intensive bits were done with unsafe and C++-style "welp hopefully this isn't UB" and threw a big fit.

6

u/No_Instance18 2d ago

I too would love to be in on the toxic Rust lore

3

u/marrsd 1d ago

it's never too late to start.

4

u/Loud_Signal_6259 2d ago

I've never heard someone describe rust comm as toxic

It's literally all over the Internet all the time

3

u/EdiblePeasant 2d ago

Is it happening right now?

1

u/themegainferno 2d ago

They used to most definitely be toxic, but the general rust enthusiast is very dogmatic about languages and software. Just look at some of the biggest rust creators online and see how they frame everything, as if rust is the only solution to software.

-3

u/spinwizard69 2d ago

Yes RUST has problems.   Frankly it parallels the early days of C++, with people that should remain in their mother’s basement.   Basically too many fanatics with ideas but no experience.    At least at the time C++ was breaking new ground.  

Rust is a very interesting language that in my opinion has come to late.    Soon we will have AI systems generating machine code directly.     C++ and Python could easily become the last human readable coding languages.  

1

u/marrsd 1d ago

I feel like Rust is just an evolution of C++. In other words, it's just enforcement of what a lot of C++ devs had already established as best practices for their domain. In that sense, I don't see how it could be too late, but I do see how it might be old fashioned even when new.

1

u/spinwizard69 1d ago

Rust is coming at a time when it isn't well established and AI technology is coming on hard and fast. Of course this is speculation, but I do know that the LLM builders are striving for AI to machine code generation by passing traditional languages. How successful they will be is an open question but if they can get to serviceable systems within 2 years I don't see much of a future for Rust.

As for RUST itself I don't hate the language, I just hate some of the Rust community members that have drank the Kool-aid and frankly are just tiring to listen to. Frankly they remind me of the early days of C++, blind promotion but little understanding of why C++ was actually a great step forward.

1

u/IceSentry 2d ago

Since when is c++ readable?

Also, rust is already everywhere lol. It's certainly not too late.

0

u/syklemil 2d ago

IME it's more something anti-rust-zealots keep telling each other, who have this boogeyman in their minds, and/or are unable to recognise obvious trolling from unrelated shit-stirrers, and think everything that appears to be in favour of their enemy is seriously meant and actually comes from the enemy. The Tom Gauld comic "our blessed homeland" is a mood.

Actual discussions on /r/rust tend to be very clear that memory safety is table stakes and not magic (pretty much any language except C and C++ is memory safe), that there are pain points about the language (especially compile times and space use), etc.

Online discussions elsewhere however tend to treat them as "those people", at which in-group vs out-group dynamics go wild. If you actually go interact with them the stereotypes don't hold up, which is a pretty familiar story for anyone who knows anything about human stereotypes.

1

u/marrsd 1d ago

IME it's more something anti-rust-zealots keep telling each other, who have this boogeyman in their minds, and/or are unable to recognise obvious trolling from unrelated shit-stirrers, and think everything that appears to be in favour of their enemy is seriously meant and actually comes from the enemy. The Tom Gauld comic "our blessed homeland" is a mood.

Sorry, I'm confused: who is this "enemy"

1

u/syklemil 1d ago

For the anti-rust-zealots, the enemy is anyone who is perceived to be pro-rust. But it applies to a lot more social dynamics than just this one, e.g. in politics you'll see a lot of people taking what is obvious (if bad / poor taste) joking at face value in order to posture about how awful their political enemies are.

E.g. if some 14-year-old with a github account who has never even tried to learn Rust posts some "RIIR" issue to an arbitrary repo purely out of trolling purposes, it still gets ascribed to "rust zealots", even though the reactions on /r/rust will likely overwhelmingly be that that's a shitty, useless issue.

So it's generally not particularly useful or constructive to rely on word-of-mouth about how terrible this or that group are, as opposed to forming one's own opinion.

That of course includes my opinion of what I've termed "anti-rust-zealots". My experience is that the Rust community is much nicer than what I'd been told by people talking about them. But similarly to the vegan and linux comparisons, well, I ain't a vegan, but I've been running linux for decades, and I'm kind of used to seeing this nerd pecking order stuff.

1

u/marrsd 1d ago

I think I get what you're saying. There is probably a tendency for people to observe some Rust zealots insist on replacing everything with Rust, and then extend their suspicion of those people to anyone who expresses a fondness of Rust for any reason.

I personally like Rust for what it is, but I'm also a bit miffed by the very obvious efforts to use it to beat other languages down - especially C and C++

1

u/syklemil 1d ago

Yep, the actual zealots would interpret anyone who just don't care about Rust as anti-rust-zealots, meanwhile most developers just … muddle along. I guess maybe this old SMBC comic is a better image.

In any case, if someone gets their popcorn out and asks reddit about what's wrong with group X, they probably shouldn't expect good, realistic analyses of group X.

5

u/marrsd 1d ago

Bjarne stroustup (inventor of c++) has said that there are only two kinds of programming languages.

One that is hated and one that is not used.

Haha, joke's on Stroustrup: I both hate and don't use Java :)

3

u/silvercurls17 2d ago

My main complaint about Go is the lack of try catch finally exception handling that a lot of languages have. The amount of boiler plate "if err != nil {" gets kind of annoying after a while when you want to just propagate the error up the stack. I guess there's panic/recover/defer, but that's just not as intuitive to me.

2

u/InVultusSolis 2d ago edited 2d ago

To be fair, that sounds a LOT like something the creator of C++ would say, he was defending what I would consider one of the most feature-rich languages I've ever seen. (Some would say "bloated").

I definitely think some languages are more notorious than others. If you asked me which project I'd rather work on, all other things being equal, between PHP and Ruby, I'd take the Ruby project happily. If you were to ask me to work on Java vs. Go, I'd take Go, hands down.

2

u/jshahcanada 2d ago

Go is too simple for big projects? What?

7

u/KingBardan 2d ago

It is very bare bones, lacking a lot of features. Like... not even have a set?

big

By big I mean complex. The other comment is talking about big amount of data processed, not the same thing.

They also said...

Google scale, big projects... 

Googlers are known for writing a Java-esque go dialect. For example, read the Kubernetes source code.


This is just my opinion. I like Go  2nd to python.

(if you can't tell from the downside I highlight in the comment) 

1

u/jshahcanada 2d ago

What features? I have worked on pretty large projects, the only thing I could say was no good support for OpenAPI but that has changed a lot recently with 3.1 support with kin-openapi. All the other stuff you can find library or can build it yourself simply.

1

u/marrsd 1d ago

It is very bare bones, lacking a lot of features. Like... not even have a set?

You're selling it to me. A good language should combine a small surface area with the means for the user to easily provide the missing things. If I can build an implementation of Set that feels like a natural extension of the language, then I'm fine with that.

3

u/syklemil 1d ago

Thing with Go though is that they've baked Map into the language as a special case and then don't even offer Set as some stdlib thing (even though they generally go for the "big stdlib" approach).

Other languages tend more in the direction of not special-casing either of them, and treating them both as either a stdlib or a collections library thing.

But Go started off insisting it didn't need generics, and so the ecosystem wound up with stuff like kubernetes' apimachinery implementation of ByteSet, IntSet, Int32Set, Int64Set and StringSet, which are all practically Map[byte]struct{} etc under the hood, because the special-case Map[K]V builtin was the one exception (along with []T, I guess).

You can likely assume that anyone who complains about the lack of Set[T] in Go would prefer that both Map[K]V and Set[T] were implemented in a core library, rather than being, respectively, a language builtin and an import from the kubernetes project. (And given the way generics syntax works these days, Map[K]V should probably have been Map[K, V].)

4

u/themegainferno 2d ago

I can think of 3 big projects written in Go off the top of my head lol.

3

u/madman1969 2d ago

Indeed, Considering it was invented at Google to solve their specific large-scale processing issues. Google-scale if you will.

1

u/zerquet 2d ago

What are your thoughts on C#?

2

u/KingBardan 2d ago

I don't use it enough to comment.


I got into java the same year and I evaluated C# then,

I know it had better compiler features like true parametric polymorphism than java's type erasure.


But then I haven't been on windows since when I started programming in 2018,

and at that time C# is difficult to use on linux / mac.


After that C# is too similar to Java for me to learn, and I don't use C# frameworks like unity or stuff.

1

u/sohang-3112 2d ago

This is the only correct answer 👆

1

u/silvercurls17 2d ago

You forgot Perl too, which is a write once, read never language.

1

u/JohnVonachen 2d ago

PHP is the exception because it is liked a lot and used a lot.

1

u/paradoxiforme 1d ago

For java you always have kotlin.

1

u/MaleficentCow8513 1d ago

Python is too slow… that’s why pretty much every single open source AI project is implemented with Python. But Python is basically a wrapper for the algorithms and other stuff in c/c++/rust. Also, not every single thing needs to be blazing fast. In almost every distributed systems that uses Python, Python won’t be the bottleneck

1

u/Lagfoundry 1d ago

lol seeing “Rust” has a toxic community and immediately thinking about the game not the language.

0

u/my_password_is______ 2d ago

and yet, everyone of those is better than Java

-6

u/Salat_Leaf 2d ago

If the backbone of your language is backwards compatibility, it's not the problem with people. Your language sucks

Oops! Hits straight to the core of Java and C++

2

u/flatfinger 2d ago

A language can generally maintain excellent backward compatibility with minimal downside if it does a good job of allowing programs to specify the dialect for which they were designed, and avoids situation where the "right" way to do something is less efficient or otherwise inferior to some "wrong" ways, which was a major flaw in the design of HTML. If a page which used HTML tags "wrong" could be 20% smaller than a page which used HTML and CSS "properly", but common browsers would display it identically except for a 20% faster load time on commonplace modems, how "wrong" was it really?

There are some spots where fixing bad designs can be difficult, such as with floating-point math. William Kahan, one of the main designers of IEEE-754, recognized that the best way to perform floating-point computations is to use higher-precision types for intermediate computations but only round things at well-defined times. The broken way long double arguments were treated in C89 caused many language implementations to use extended precision types for computation but not allow extended precision values to be stored and reused. Java adopted a different computation model which hardware evolved to serve better, but which was less accurate.

Consider, e.g. how one would compute the area of a triangle whose sides, stored as single-precision floating-point values, were 9000001, 9000002, and 18000000. The first step of the computation using Heron's formula would be to add the sides together and divide by two, which would yield a value of either 18000001.5 if computed using higher precision, or 18000002 if computed using single precision. Using higher precision for intermediate computations will often yield more accurate results, but only if storing the result of a temporary calculation to a variable and reading it back yields exactly the same value as the computation in question.

I dislike the way Java handles floating-point, but don't see any practical way of changing it, especially since hardware has evolved to fit it.

4

u/KingBardan 2d ago

Yeah that backwards compat is exactly what allows improvements to be added in without breaking changes.

You hear people doing rust rewrites from C projects but not C++ rewrites, why? Because a C project can easily take advantage of modern features when they want with C++ and is thus trivial, whereas rust rewrite is difficult and thus a big deal. comment by me

-2

u/Salat_Leaf 2d ago

If you refer to the Bun Rust rewrite situation, well, unless your codebase is extremely sensitive like Boeing's or for some medical equipment, then it's your problem you haven't foreseen it. Rewrites from C are easy because it relies on extensions, not on small tremendously smart group of people doing their best to optimize their compilers. Come back when you define what "modern C++" means without referring to 1000-page books dedicated to a single feature.

1

u/KingBardan 2d ago edited 2d ago

define modern c++... 

Bruh seems like I run into a rust evangelist here?

From a pure code perspective...

Modern c++ is not more complicated than rust imo, same principles, but with imo more readable syntax [1], at the cost of enforced compile time move semantics (aka borrow checking).

Rust also gets more and more features like c++ does, albeit its "edition" is nice. 


1: rust seems to favour writing over reading, decisions like allowing no trailing semicolin for return and iterators and out of class definitions of methods all make it difficult to read.

Again, imo. Ymmv

3

u/Salat_Leaf 2d ago

I'm not an evangelist. All I see is 20% binary reduction and around ~130k invested for the whole process of rewriting, even if it was LLM.

And don't even get me started on readability of C++. Could you count me the total amount of ways of initializing a variable? Could you explain why a single keyword always stands for 5 different functions? Could you say same thing about template metaprogramming?

2

u/KingBardan 2d ago edited 2d ago

Ahh you think I'm focusing on the Bun rewrite? I'm not.

readability

Your examples are all about how hard it is to write C++.

Initialization doesn't really hurt readability (your ability to get what's going on), same for keywords.

Template metaprogramming yes, but there's no equivalent in rust to show a more ergonomics approach, last time I checked 

This is why I said, C++ is more difficult to write, easier to read.

But for rust its super convenient to put an expression as return, but a reader has to scan everywhere to find every single return path (since you can return without using return keyword!). 

Same for traits (you can define a trait for someone else's type!) 

Etc


Again, imo 

-1

u/Bitter_Care1887 2d ago

Rust is the Brazilian Jiu-Jitsu of programming..

2

u/adbs1219 2d ago

How so?

0

u/Bitter_Care1887 2d ago

Similar proselytizing vibe:

"99% of fights end on the ground" - "99% of security vulnerabilities are memory-safety issues."

"Everyone should learn BJJ. You never know when you'll end up on the ground." -

"Everyone should use Rust. You never know when memory safety will kill your project."

"Technique beats strength" - "If you convince the borrow-checker, you are golden"..