← Home ← Back to /g/

Thread 105818615

44 posts 8 images /g/
Anonymous No.105818615 [Report] >>105818779 >>105818788 >>105819196 >>105819233 >>105819253 >>105819297 >>105819320 >>105819536 >>105819570 >>105819601 >>105820871 >>105822148 >>105823318 >>105823358 >>105823397 >>105823637
Is Java Just a Terrible Language?
>be me
>playing 1.12.2 Modded Minecraft with friends like the good old times
>friend remembers an old idea we talked about for a mod
>Nostalgia.gif
"Anon we should make it!"
>say Sure
>I already know C/C++ and some C#
>learning ForgeAPI and Java can't be that bad right??
>idea.png
>maybe I can gleam some idea of what I'm getting into if I read the code of some mods I'm familiar with
>download JD-GUI program and de compile a few mods
>oh god my eyes
>why is everything so fucking verbose??
>why is everything refactored and fragmented into a million classes??
>wtf is this design philosophy that's baked into this language
>try to follow the the code of a single small class and it's methods, end up with 30 other class tabs open and a headache
>I can't parse shit in any meaningful time

Why does this language feel like a gordian knot of shit. Is this why Pajeets program in this unreadable language so that they can create unintelligible programing atrocities only they know how to maintain or fix?
Anonymous No.105818773 [Report] >>105819643
Just git gud at it.

Still nothing beats it to write backend. I mean serious backend, not your 10 concurrent user crud app. Especially any pythonic shit.
Anonymous No.105818779 [Report]
>>105818615 (OP)
Minecraft's codebase is shit (and was even moreso 7 years ago, it all went to shit when they switched to their server-client mixed crap rachitecture, back then it was still ugly but also much simpler) so is Forge's. Modern Java looks acceptable. Has niceties like Records to reduce plenty of the boilerplate.
Anonymous No.105818788 [Report]
>>105818615 (OP)
you're a retard
Anonymous No.105819196 [Report]
>>105818615 (OP)
Piss on best practices and make a god class. Treat classes like you would modules in sane languages. Die a little whenever you write some string sanitizer and add it to a class as a method, but still do it. Fuck this language.
Anonymous No.105819215 [Report]
>Filtered by Java
a grim fate
Anonymous No.105819233 [Report] >>105823643
>>105818615 (OP)
Other than the added verbosity, Java isn't terribly different from C#
Anonymous No.105819253 [Report] >>105819443
>>105818615 (OP)
Nobody actually gave you an answer so I will. Java the base language is decent. The culture of verbosity, excessive abstraction and indirection that permeates the ecosystem makes it shit and it comes from the fact that Java was the big and popular "OOP" language during the sad period of time when over-abstracted design patterns got popular. So all the Design Patterns Bros migrated to and worked with Java, and in turn the Java programmers ate that shit up and made it the foundation of their ecosystem.
Anonymous No.105819297 [Report]
>>105818615 (OP)
import or #include
6 one way, half dozen the other.
Anonymous No.105819320 [Report]
>>105818615 (OP)
Modloader was readable, but deprecated because forge was more java sir
Anonymous No.105819443 [Report] >>105819476
>>105819253
Enforced one class per file is not culture, dumb fuck.
Anonymous No.105819476 [Report]
>>105819443
>one class per file
You clearly never worked on one of the retarded pattern-heavy codebase Java is infamous for: the one class per file rule is not the problem. The problem is that people write 10000000 4-lines classes. And that's 100% a cultural issue.
Anonymous No.105819494 [Report] >>105819663
C++ is at least as verbose and much more complex
C is too low level, it would be a terrible application language
all three languages are Algol shit
Anonymous No.105819536 [Report]
>>105818615 (OP)
>ForgeAPI
use fabric retard
Anonymous No.105819570 [Report]
>>105818615 (OP)
what's the point of this? if you're coming to Java from hobby projects that fit in one file in other languages, to a predominantly enterprise language used with frameworks, what do you expect?

are you also surprised when you see a React codebase?
Anonymous No.105819601 [Report]
>>105818615 (OP)
>be OP
>decompile a java class
>OMG IT LOOKS SO FUCKING AWFUL MY HEAD HURTS WHAT DOES ANY OF THIS MEAN
filtered
Anonymous No.105819643 [Report] >>105820814
>>105818773
Rust, Go, Kotlin and C# have dethroned it for Greenfield projects. Java is confined to legacy hence the oop nightmares you will sufffer, Java was at it peak powers when the clean code craze was.
Anonymous No.105819663 [Report] >>105819725 >>105820844
>>105819494
What the fuck is low level about C?
Anonymous No.105819725 [Report] >>105819802
>>105819663
it's a DSL for high level assembly
Anonymous No.105819802 [Report] >>105820760
>>105819725
That was true about 40 years ago.
Anonymous No.105820760 [Report] >>105820829
>>105819802
It still mostly is. You need to seethe more.
Anonymous No.105820814 [Report] >>105820860
>>105819643
>Rust, Go, Kotlin and C# have dethroned it for Greenfield projects.
It varies very much from place to place. We wouldn't touch Rust, Go or Kotlin with a bargepole, and use both C# and Java quite a bit (depending on platform and developers).
Going by my coworkers' complaints and struggles, C# still manages to suck compared to Java for doing basic webapp backends. Which is weird; how did MS manage to fuck up that well-known a task?
Anonymous No.105820829 [Report]
>>105820760
What non optimizing compiler do you use?
Anonymous No.105820844 [Report] >>105821376
>>105819663
"low level" has completely changed in meaning, it no longer exclusively refers to assembly languages but instead any compiled language that isn't abstracted to hell and back.
Anonymous No.105820860 [Report]
>>105820814
>Which is weird; how did MS manage to fuck up that well-known a task?
my friend, are you familiar with Microsoft's history?
Anonymous No.105820871 [Report]
>>105818615 (OP)
Most mods are open source, why are you decompiling them instead of just reading the original source code?
Anonymous No.105820899 [Report]
Java is fine, you just suck at abstraction
Anonymous No.105821376 [Report]
>>105820844
Yes, the meaning has changed among pissant Redditor novices.
*If* you want to about low level outside assembly, here are better ways to do that. Say:
- low-level operations
- C is lower level language [than Java]
Anonymous No.105822148 [Report]
>>105818615 (OP)
Skill issue. Java is really easy to modify and understand, I even made an hacked client for 1.19 just by editing bytecode.
Anonymous No.105823090 [Report]
what's wrong with classes?
it's better to have classes than 10k+ LOC spaghetti in C/C++.
people just don't understand what they're complaining about.
Anonymous No.105823107 [Report] >>105823414
because classes introduce code isolation, it's easier to reason about code inside classes, because classes are usually short, have less dependencies etc. they're like program's atoms.
Anonymous No.105823318 [Report] >>105823414
>>105818615 (OP)
Minecraft is the only thing in the world using java kek
Anonymous No.105823358 [Report]
>>105818615 (OP)
>java is so hard to understand!!!
>decompile a java standard library class
>readable and easy to follow
>read a c++ standard library header
>__retarded__syntax::_std::<>[]_we_Are_Sociopaths() { __M::_very_readable_code{}() requires auto -> { new std::bjarne_is_a_nigger(); } noexcept ();
lmao kys fag
Anonymous No.105823397 [Report]
>>105818615 (OP)
>Why does this language feel like a gordian knot of shit. Is this why Pajeets program in this unreadable language so that they can create unintelligible programing atrocities only they know how to maintain or fix?

Literally the opposite. The whole point is to break down the code to little self contained pieces that can be developed individually without any particular skill or knowledge so that you can treat the workers as replaceable cogs rather than having to pay them a living wage. Though it's only just now becoming super apparent and undeniable, this has been big tech's dream since forever, to make programming a low paid wagie job.
Anonymous No.105823414 [Report] >>105823473
>>105823107
>classes introduce code isolation
For sure, until you call some other class and then the rat's nest starts to form. In the end it isn't any better than C modules with it's header files when it comes to isolation, a shit programmer will end up with leaky code anyway, 0 isolation, and it will be just as unreadable regardless of the language or the existence of classes.
>>105823318
If you ignore like half of the corporate world, I guess.
Anonymous No.105823473 [Report] >>105823548 >>105823722
>>105823414
>until you call some other class
but if classes have clear names then you don't need to follow these classes to understand the meaning of code.
if class Car uses class Engine with methods start() and stop(), you don't need to look up the Engine class to reason about Car behavior.
Anonymous No.105823548 [Report] >>105823722
>>105823473
you do if you have to reason anything that's even slightly non-trivial
Anonymous No.105823637 [Report]
>>105818615 (OP)
Java died.
Python ate its lunch for everything but web browser shit which is Javascript.
There's no usecase for any language but LLM and Python with Pytorch anymore, with CSS for styling and maybe Objective C to spin up a webview on iPhone for your "app" which is really just your webpage with bigger buttons.
Anonymous No.105823643 [Report]
>>105819233
> Other than the added verbosity
But this makes it insufferable crap. As much as I hated Microsoft I couldn't deny that C# is the much cleaner and more elegant implementation of such a language.
Anonymous No.105823674 [Report] >>105823932
Java became relevant because Sun spent ungodly amounts of money forcing it everywhere, and stayed relevant because it aligns with the dispassionate and mindless way that very large "enterprise" software is made. Wagies would rather spend all day writing boilerplate than using their brains
Anonymous No.105823722 [Report] >>105824304
>>105823473
>good code is easy to read
This isnt tied to classes. Also what >>105823548 said
Anonymous No.105823932 [Report]
>>105823674
>the dispassionate and mindless way that very large "enterprise" software is made
Microservices killed exactly the problem space that enterprise patterns supported. You don't need strategy delegate visitors if you have a separate cloud function shitcode crapped out on a vibe for each case.
Anonymous No.105824154 [Report]
>>I already know C/C++ and some C#
how is c# any different than java?
>>download JD-GUI program and de compile a few mods
>>why is everything so fucking verbose??
the absolute state
Anonymous No.105824304 [Report]
>>105823722
it's tied to classes, because classes touch less state. typical class may have 3-5 members.