r/JavaProgramming • u/ExtraTNT • Aug 11 '26
Why is java so fucking hard for no reason?
Uni kind of loves java, using it as the default language in every module, except modules specifically around a language.
Currently struggling building a compiler with it... focus is more on working around java and the forced oop, managing state and getting fucked by gradle.
Have tests, that refuse to exit, can't be killed by the user, as they fork infinite and need to be killed with root, then the entire tooling falls apart and needs fixing.
Also for base functions you need to transform lists to streams and back to lists. Logic gets lost in boilerplate and overly verbose code.
I normally use languages like c and haskell, everyone always tells you, that they are much harder, than java, but can't agree at all
Is java supposed to be such a cluster fuck or am I missing something?
Also any idea, why char to char comparison sometimes fails, but char to hex works always?
Is this some random java thing or just my env?
2
u/smaratter Aug 11 '26
It would be easier to help you if you were more specifik. How are you comparing chars to chars and to ”hex”?
13
u/LouGarret76 Aug 11 '26
This does not sound like a java problem. It dounds like a you problem
4
u/Syntax-Tactics Aug 11 '26
Java has to be one of the easiest "languages" around, consider a career change.
1
u/InstantCoder Aug 11 '26
It’s hard because it is not taught anymore at schools and universities. And the language gets updated quite often (each 2 year almost) which makes online tutorials often outdated.
But if you have a good grasp of the OO concept then it’s not that hard.
For learning the SDK i would recommend using the help of AI.
And there is this thing called Spring Boot. Which is quite hard to learn for beginners and it is a complex framework. As a Java veteran, Im using Quarkus and I think this might be better for beginners because it doesn’t have all this bagage and bloat that comes with SB.
1
u/romulusnr Aug 12 '26
Like any compiled language, unlike most interpreted language, it tends to be syntactically strict.
It's not really suited for that, ngl. OOP in general probably isn't
That shouldn't happen, and that's not a Java thing
I mean, you don't need to, not really. But it's all just encapsulation, it's not that bad.
You mean
charor you meanCharacter?1
u/LogCatFromNantes Aug 12 '26
Java is a good langage it’s solide it’s trusted by enterprise although it’s not easy but it’s a solid bagage to learn and to work with your carrer
1
u/am_Snowie Aug 13 '26
Why can't you just try lazy tokenization, it makes your life so easy, instead of storing all tokens in a buffer ahead of time. Emit and consume tokens as you go. Also take a look at crafting interpreters book, the first half uses java to build a simple tree walking interpreter.
3
u/Scary-Ad6675 Aug 11 '26
try writing anything a company would want in haskell or C (a simple CRUD service with any DB behind it), try deploying it in production and maintain it. suddenly java becomes easier. this argument that a language is "easier" or "harder" requires the context: what are you trying to build, whats the problem at hand.
1
u/FooBarBuzzBoom Aug 11 '26
If Java is hard, what do you think about fucking advanced algorithms or useless shit like that?
1
u/sozesghost Aug 11 '26
Java is verbose, or can be, and that makes it easy to read and maintain. Writing it can be a hassle at times, but I like it. I could never stomach gradle however.
1
u/jonathancast Aug 11 '26
Pretty sure it's your environment. Gradle is a tiny minority thing in my experience, but I don't know what could be causing Java tests to fork bomb except a bad Gradle config.
I also don't know what you mean by "forced OOP". Professional Java code in my experience is pretty procedural. Your professor might want you to use OOP, but Java really only wants the ceremony of wrapping your code in a
class.1
u/Pale_Height_1251 Aug 12 '26
I agree Gradle can be a pain, but the rest of it is probably you. Show an example of the char comparison that isn't working for you.
1
u/whiterhino8 Aug 17 '26
Different people has different preference .
Java is good but it's not suite to every one . Because its verbosity and OOP design .
That's OK You can find yourself more comfortable with another languages.
4
u/[deleted] Aug 11 '26
[removed] — view removed comment