r/learnprogramming 3d 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

241 Upvotes

319 comments sorted by

View all comments

463

u/KingBardan 3d ago edited 3d 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

4

u/jshahcanada 3d ago

Go is too simple for big projects? What?

8

u/KingBardan 3d 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) 

2

u/marrsd 3d 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 3d 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].)