this post was submitted on 13 Nov 2024
404 points (96.8% liked)

Greentext

6613 readers
1581 users here now

This is a place to share greentexts and witness the confounding life of Anon. If you're new to the Greentext community, think of it as a sort of zoo with Anon as the main attraction.

Be warned:

If you find yourself getting angry (or god forbid, agreeing) with something Anon has said, you might be doing it wrong.

founded 2 years ago
MODERATORS
 
top 50 comments
sorted by: hot top controversial new old
[–] svcg@lemmy.blahaj.zone 107 points 7 months ago (1 children)

I also think Java is shit, but if you manage to get a NullPointerException while writing a hello world program, maybe anon is just not cut out for computers?

[–] navi@lemmy.tespia.org 54 points 7 months ago (2 children)

I always loved that Java has a NullPointerException but doesn't have the concept of pointers in the language (only references).

[–] dukatos@lemm.ee 28 points 7 months ago (2 children)

That is because they planed to add pointers and then gave up.

[–] RogueBanana@lemmy.zip 19 points 7 months ago

I can't tell if you are making a joke but I can believe it could happen if it's Java

[–] morrowind@lemmy.ml 11 points 7 months ago

I mean... they have them. And unsafe. You're just not supposed to use them

[–] starman@programming.dev 10 points 7 months ago

C# has NullReferenceException and it actually makes sense.

[–] unexposedhazard@discuss.tchncs.de 69 points 7 months ago

Java

Thats your first mistake bucko

[–] Ilovethebomb@lemm.ee 36 points 7 months ago (26 children)

Can anyone who's actually dealt with Java tell me how much Anon is exaggerating?

[–] scottmeme@sh.itjust.works 51 points 7 months ago (5 children)

I've worked on a corporate project with multiple Java services, anon isn't really exaggerating. Java can be a hell scape at times

[–] taladar@sh.itjust.works 20 points 7 months ago (1 children)

They forgot to mention that production Java applications apparently need to log a certain minimum number of completely meaningless stacktraces per hour to work properly. Or at least I assume that is the case from the fact that all of them do that.

[–] HackerJoe@sh.itjust.works 13 points 7 months ago (1 children)

Best with an old and vulnerable log4j on a Windows log server.

We don't know what'll happen if we update. And we don't know if the dude who coded it will answer our calls. YOLO!

load more comments (1 replies)
load more comments (4 replies)
[–] kitnaht@lemmy.world 34 points 7 months ago* (last edited 7 months ago) (3 children)

I'm pretty sure Java doesn't have pointers, so writing a hello world application isn't gonna fuck up nearly that hard.

The one thing he forgot though is that your source file is probably in the folder

com/companyname/net/classes/factory/factoryfactory/worker/lib/bin/refresh/jdk/model/ui/closebutton/press.java

And spread out among a bunch of other directories, and the java file is like...3 lines. But there are 10k files spread all around directories like this that are all 3 lines a piece with a class definition.

[–] SpaceNoodle@lemmy.world 17 points 7 months ago

Everything in Java is a hidden pointer

[–] perviouslyiner@lemmy.world 7 points 7 months ago (1 children)

wait, so when .io gets deregistered, are a load of companies going to have to rename their root directories and rewrite all of their include statements?

[–] kitnaht@lemmy.world 18 points 7 months ago* (last edited 7 months ago) (1 children)

Thankfully, despite naming them like that, it doesn't actually seem to have any real purpose. Apparently they just wanted to make sure that different companies making different libraries didn't accidentally use the same name for their project....

[–] Hawke@lemmy.world 8 points 7 months ago

That’s exactly the reason. And also no company is going through the bother to refactor that shit, so everything is named based on some other company 5 mergers and acquisitions ago.

load more comments (1 replies)
[–] chunkystyles@sopuli.xyz 21 points 7 months ago (4 children)

I've been programming in Java professionally for 11 years. It's not just embellishment, it's outright lying.

Threads giving you race conditions? All concurrent programming will do that if you're shit at it.

Java has come a long way. I will admit that UI in Java is terrible. I would never do that.

[–] crusa187@lemmy.ml 8 points 7 months ago (1 children)

Been coding Java for about 15 years now. Pretty much agree - anon’s primary mistake was using javaFX. From a junior dev perspective I can see why they’d do that, but Java isn’t really meant for building desktop applications, it’s meant to power web apps.

What they should have done instead is create a backend restful web service and wire up a frontend rest client with something suited to web app ui dev such as angular or react. Java has some awesome frameworks built for it over the years, something like spring boot would make building that backend service trivial if you know how to use it. JAX-RS/Jersey or even servlets could be utilized for this instead, if you wanted to.

Spring boot has some nice tooling for thread management, but Java also has pretty good options for this built in as well. As chunky mentioned, if you aren’t already versed in concurrency patterns, don’t try to perform concurrent operations or you’re gonna have a bad time. But do learn how to do this, because exploiting concurrency is one of the golden rules of good computing.

load more comments (1 replies)
[–] extremeboredom@lemmy.world 7 points 7 months ago* (last edited 7 months ago) (1 children)

It's not accurate to accuse Anon of "lying," when both their story and yours would point to the race conditions from threads being a symptom of someone who's just learning the language.

It's not that serious though; because it's a greentext, it is both artificial AND homosexual.

load more comments (1 replies)
load more comments (2 replies)
[–] Lysergid@lemmy.ml 19 points 7 months ago* (last edited 7 months ago) (2 children)

95% exaggeration. Here is reality:

  • yeah you need main class coz it’s OO-language. Though, not required anymore, which should’ve been done once Java got scrip language capabilities (jshell) back in JDK 9. But as of today not required anymore
  • imports exist in most if not all languages. Gotta be insane writing them manually in 2010 let alone 2024
  • installing Java runtime (JRE) is as simple as installing any app. Though for installing JDK you need 5 mins for setting PATH. Think about JDK as like TSC or Webpack and JRE as a Browser. I’d argue installing and configuring JDK is simpler than TSC or Webpack
  • Unless you doing some non-trivial multi-threading your stack trace will tell you exactly where is your NPE. You gotta be as blind as my teammates to spend more than 1 minutes to find where it is coz it literally tells you file and line numer where Exception occurred
  • I mean, yeah if you use IDE from 2000 it will look like it. IntelliJ looks modern, though I don’t like the fact latest versions look like VSCode
  • I hardly reach 3G of deps from all 10 projects I have on my workstation.
  • IDK what anon means by ecosystem here, Java ecosystem is quite standard across the board. JDK(std lib), Maven/Gradle(deps, build, publishing), Spring Framework (all sorts of blueprints and solutions to standard app level problems), Hibernate/JPA (ORM), JUnit+Mockito (testing). These are tools and libs used in 90% of projects I worked on. Of course there will be more depending on project needs. Layers? It’s not like language imposes any layers whatsoever. It’s just common practice to have 3-4 layers and some glue in-between.
  • don’t do GUI in Java it sucks and will suck until Java gets string interpolation. Hopefully soon
  • concurrency is actually the only thing which is really bloated in Java. Which will change with next LTS version if I remember correctly. And it’s not that hard if you actually read the f manual and not just “try and hope”. Again it will become much more efficient and easier to follow soon. As of now - yeah, not trivial. But people mostly prematurely optimize, so karma
  • Java is kinda have 20 ways to do same thing but actually no. Java built with idea of providing simple building blocks. Then it provides more specific API built on top of those building blocks. It allows to have API which solves typical problems and provides capability to solve custom problems with those building blocks. People often confuse this as many ways to do one thing but it’s like saying “I can have byte array why I need string data type”. Those are different levels of abstraction

Edit: typos

[–] rumba@lemmy.zip 12 points 7 months ago

95% exaggeration if he is a real programmer.

If he just tried to walk into Java knowing nothing or maybe PHP, and refused to RTFA, he might experience about 30% to 40% of that I just trying to do everything wrong.

load more comments (1 replies)
[–] bluelion@sh.itjust.works 18 points 7 months ago (2 children)
  • a hello world doesn't need libraries in Java
  • installing JDK takes at most 5 steps, depending on the OS
  • a nullpointerexception is more likely the developper's fault (unassigned value, calling a function on a null object)
  • IntelliJ is easy to install and modern (granted, other IDEs are very ancient)
  • developping GUI apps is a PITA, no matter the ecosystem (generally)

The rest is more or less spot on (no idea about concurrency issues though)

[–] Blue_Morpho@lemmy.world 11 points 7 months ago (1 children)

nullpointerexception is more likely the developper's fault

Of course it was the developer's fault. But it's absurd a language without pointers throws an error about pointers.

[–] Lysergid@lemmy.ml 8 points 7 months ago (1 children)

I guess naming it NullReferenceException will revolutionize industry

load more comments (1 replies)
load more comments (1 replies)
[–] schteph@lemmy.world 11 points 7 months ago (3 children)

Java is religiously backwards compatible. Modern java projects are not as enterprisey and boilerplatey, but, as jdk21 is backwards compatible with jdk1.3, you can still happily write code as if it's 2003.

Additionally, the java space is huge, so just wildly googling will probably not help you that much.

load more comments (3 replies)
[–] Valmond@lemmy.world 10 points 7 months ago (3 children)

I have developed in java and C/C++ (many years) and Anon is maybe exaggerating a bit but not lying, we all have been there more or less.

Personally I hate how java forces you into bad architectural choices. Where is the unsigned int? Why isn't an int a class BTW? Why the pass by copy for some, by reference for others? Where is multi inheritance? Lots of things are dumbed down or you have no choice in the matter.

Sure didn't help it was a power hungry beast moving at snail speed back in the day too.

load more comments (3 replies)
[–] Aganim@lemmy.world 8 points 7 months ago

Anon pretty much sums up my experience with Java when I had to learn it in college 20-ish years ago. I'll never get rid of my distaste for the language I'm afraid.

load more comments (18 replies)
[–] KoalaUnknown@lemmy.world 28 points 7 months ago (10 children)

Am I weird for liking Java? I feel like it just makes so much more sense than other languages.

[–] Serinus@lemmy.world 25 points 7 months ago (16 children)

C# is nearly the same, but much, much better.

  • It doesn't (usually) come with the Java culture 8 layers of abstraction. This isn't in the Java language. This isn't in OO. Yet nearly every Java programmer makes things way more complicated than it needs to be.
  • It's a prettier language. Similar syntax with less bullshit.
  • It's open source
  • It's still multiplatform. Modern dotnet / C# works on anything.
  • Both Visual Studio and Visual Studio code are great IDEs that blow Eclipse out of the water
  • It's one of the most common business languages.
  • It's going to be supported forever.

If I could restrict the world of programming to two languages, it'd be C# and Rust. C# for most things and Rust for a lower level language.

[–] alsimoneau@lemmy.ca 9 points 7 months ago (2 children)

I'll take Python and Fortran, thank you very much

load more comments (2 replies)
load more comments (14 replies)
[–] sentient_loom@sh.itjust.works 15 points 7 months ago

I like how straight-forward the syntax is. And it also seems orderly to have everything be a class. There's a system to it.

I'm using C++ for a project now and I like it in a similar way, but there's more freedom (everything doesn't HAVE to be a class). So with C++ I'll never go back to Java (unless it's for a job).

[–] chunkystyles@sopuli.xyz 14 points 7 months ago (1 children)

No. Every language has its haters. There's a reason Java is so widely used. If you like it, keep at it.

[–] tempest@lemmy.ca 11 points 7 months ago (2 children)

Yes and the reason is because millions of lines of production code were written and it isn't worth rewriting them.

Plenty of languages around now that don't have 30 years of baggage and the specter of Oracle hanging over it.

Now a days many businesses choose Go.

load more comments (2 replies)
[–] dev_null@lemmy.ml 8 points 7 months ago* (last edited 7 months ago) (3 children)

I thought I like Java until I tried Kotlin. It's everything I liked about Java, but with everything wrong with it fixed.

load more comments (3 replies)
load more comments (6 replies)
[–] AusatKeyboardPremi@lemmy.world 21 points 7 months ago (5 children)

I might have agreed a decade or two ago, when I knew no better. But today, I find the tribalism surrounding programming languages comical.

I don’t particularly like Java, but I use it because it pays the bills. Similarly, I use C++ (which I prefer) when my work requires it.

[–] SorteKanin@feddit.dk 21 points 7 months ago

I don’t particularly like Java, but I use it because it pays the bills. Similarly, I use C++ (which I prefer) when my work requires it.

I mean, anon is not arguing against that. They're saying the language is shit regardless of how much it is used in business. I don't think they are entirely wrong.

load more comments (4 replies)
[–] Orbituary@lemmy.world 21 points 7 months ago (6 children)

My old boss is one of the 3 initial creators of Java. He ran our department the same way this greentext reads.

He was also a paedo. You can figure out the rest if you dig.

[–] remi_pan@sh.itjust.works 9 points 7 months ago

Known for : the Java programming language, internet sex crime and the fantasy defense.

load more comments (5 replies)
[–] babybus@sh.itjust.works 19 points 7 months ago (7 children)

If it took anon 30 minutes to write hello world in java, programming is not for anon.

load more comments (7 replies)
[–] jrgn@lemmy.world 15 points 7 months ago (1 children)

Not using Eclipse helps. Using Scala helps even more

load more comments (1 replies)
[–] _____@lemm.ee 14 points 7 months ago (4 children)

C# masterrace and I'm tired of pretending it's not

load more comments (4 replies)
[–] Batman@lemmy.world 13 points 7 months ago (1 children)

My inner mathematician respects Java. The first step in any problem is defining your universe

load more comments (1 replies)
[–] Ab_intra@lemmy.world 11 points 7 months ago (1 children)

Just imagine how it must have been to code Minecraft 🤣

[–] joyjoy@lemm.ee 13 points 7 months ago (4 children)

They only had to deal with LWJGL. The corporate java world has to use Spring.

load more comments (4 replies)
[–] WormFood@lemmy.world 9 points 7 months ago (7 children)

object orientated programming is the wrong idiom for almost all problems, and even in the few cases where it makes sense, you have to be very careful or it'll hurt you

load more comments (7 replies)
[–] sentient_loom@sh.itjust.works 8 points 7 months ago

You're not stuck with it Anon. You can use something different!

[–] yokonzo@lemmy.world 7 points 7 months ago

I started with java for school. The day I tried C for the first time I was flabbergasted, "what do you mean it doesn't matter which order I put things in?"

load more comments
view more: next ›