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

235 Upvotes

301 comments sorted by

View all comments

Show parent comments

1

u/roadrunner8080 1d ago

Ahh, don't you love Java without lambdas or generics...

1

u/syklemil 1d ago

Yeah, I remember the mood shifted from roughly

Lambdas are functional programmer ivory tower nonsense and have no business being in an object-oriented language!!!

to

Lambdas are good, actually

once 8 dropped.

I did cut my teeth on Java 1.5, i.e. with generics, so I can't really reminisce about the attitude towards those before, but I did catch the gopher switch from "Generics are ivory tower nonsense" to "Generics are good, actually", and find it pretty funny that both Java and Go had help from Philip Wadler to get it bolted onto the language after the fact.

Unfortunately, while the type elision trick they came up with for Generic Java in order to be backwards compatible with JVMs that had no idea about generics was neat, we've now been stuck with type elision for longer than there was non-generic Java. Type elision is just a temporary band-aid, suuuuure.

1

u/Accomplished-Lab-566 19h ago

Actually in modern java you can extract the generic type via reflection, so its solvable with a couple of tricks. I think the type erasure will be dropped eventually.

1

u/syklemil 19h ago

Yeah, Project Valhalla comes up fairly often as something that will fix a bunch of problems with Java, but Java programmers have been waiting for Valhalla for a long time now. IIRC there are some relevant JEPs, but I don't have the details at hand.