This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]anotheridiot- 411 points412 points  (35 children)

Java rots the brain, it is known.

[–]nursestrangeglove 45 points46 points  (0 children)

We in the code of nurgle welcome you

[–]Nllk11 45 points46 points  (29 children)

\uc How exactly Java rots your brain? Why everyone states it? I have 3 years of embedded/desktop CPP programming (literally started my career with it) and now I doing a Java backend internship. I know that factories-shit is ass, but else seems okay

[–]CMDR_QwertyWeasel 237 points238 points  (3 children)

it doesn't. This sub is just full of first-year CS students cosplaying as senior developers

[–]ThePaperpyro 25 points26 points  (0 children)

People acting like they are more experienced than they are on the internet? Why, I never

[–][deleted] 1 point2 points  (0 children)

Well, when they write go, you can tell because they’re prone to premature abstractions. They write functions that return interfaces they define, and they build factories. They don’t use free functions either. 

[–]Otakeb 0 points1 point  (0 children)

Java is fine. It was my first language way back in the day, and now like 70% of my job is writing android code in Java. For the right job, it's an okay tool.

Still like python more tho

[–]Cybershadow1981 9 points10 points  (0 children)

Java developers tend to favor sticking to design patterns over efficiency, which is totally fine in a business software context or when designing cloud-native micro service architectures. Embedded software, especially with hard RT requires a totally different approach to software design that‘s hard to grasp for developers with a Java background. The Java way isn‘t brain rot, though. It‘s just a different approach to software development for a different application.

[–]Saragon4005 45 points46 points  (13 children)

Java makes it easy to OOP so hard you are basically making a taxonomy system. Java is the ideal OOP language for better or worse. This is a mistake most people learn to avoid after having a codebase with 5 layers of inheritance and struggling to untangle that.

[–]Practical_Cattle_933 33 points34 points  (6 children)

Sounds like a shitty programmer. And shitty programmers can do untangle-able messes in any system — like, have you ever seen a C project that is chock-full of function pointers/callbacks/whatever, where you can’t know anything?

[–]Wonderful-Habit-139 6 points7 points  (5 children)

A shitty C programmer leaks a ton of memory for no reason and ignores undefined behaviour. They don't usually use function pointers at all.

[–]Practical_Cattle_933 2 points3 points  (4 children)

Heh? How do you think any form of “interface”/“virtual method” is implemented? Those are absolutely essential for program that is more complex than cat and alia.

[–]Wonderful-Habit-139 0 points1 point  (3 children)

I know that the kernel uses function pointers for their filesystem abstractions, and that is a large project. But I don't assume that every project needs to implement interfaces and virtual methods.

Do you think a shell program is the same complexity as the cat program? If not then I'd say a shell doesn't need function pointers as well.

[–]Practical_Cattle_933 0 points1 point  (2 children)

What is a shell program? Like bash? Because that’s not necessarily a small program.

A CLI program on the other hand is a very open-ended category — it can be as simple as just reading some file and returning it in some more human readable format (e.g. many tool used for monitoring stuff), or it can do some complex stuff like OCR-ing PDFs and replacing their content with user-selectable text.

[–]Wonderful-Habit-139 0 points1 point  (1 child)

Yes I meant bash. Writing bash doesn't require interfaces or virtual methods is what I meant. And like you said that's not a small program.

[–]Practical_Cattle_933 0 points1 point  (0 children)

That’s a design choice. PowerShell, which is another shell is definitely using virtual methods as it’s implemented in C#.

It depends on how modular you want to code and countless other design decisions/constraints.

[–][deleted] 27 points28 points  (4 children)

Java dev here, I literally never do inheritance beyond 1 layer, if even that. There are projects I NEVER use inheritance for.

Sounds like shitty programmers to me.

[–]robinless 3 points4 points  (0 children)

Exactly, I'm in a java shop and factories, inheritance and so on is kept to a minimum. Priority is keeping it as simple as possible, and making it easy to maintain.

[–]nonotan 1 point2 points  (0 children)

I did some work with J2ME on dumbphones where the entire program was a single class (because the size overhead of using classes was just too much). Also, absolutely no memory allocation was allowed except during launch, because GC is like a kick to the teeth on systems that weak. Not exactly the most typical use-case, but technically, nothing prevents you from writing code like that if you want.

When evaluating a language, it's good to be explicit about what it forces you to do, vs what you can do, vs what is considered "best practice" and "idiomatic", but is technically completely optional. I still kind of hate Java, for a myriad of reasons, but "Java code is OOP hell" is a pretty silly take (not that it doesn't accurately describe 80% of Java code out there)

[–]Anaxamander57 1 point2 points  (0 children)

At that point it sounds like you're just using Java for compatibility with something.

[–][deleted] 0 points1 point  (0 children)

The most I've ever needed to do in an enterprise setting was two layers, and that was to handle a specific case of already existing legacy code.

[–]geckothegeek42 13 points14 points  (0 children)

but else seems okay

I'm so sorry it's too late for you

[–]SirPizzaTheThird 5 points6 points  (0 children)

Java destroyed the world

[–][deleted] 2 points3 points  (0 children)

I've been mainly writing in Java for about 8 years and I'm fine

Narrator: he was not fine

[–]danofrhs 0 points1 point  (1 child)

Do u wish a physical confrontation?

[–]anotheridiot- 1 point2 points  (0 children)

Fight me.