this post was submitted on 14 Jun 2024
658 points (92.8% liked)

Programmer Humor

19551 readers
986 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 

Stop comparing programming languages

  • Python is versatile
  • JavaScript is powerful
  • Ruby is elegant
  • C is essential
  • C++
  • Java is robust
you are viewing a single comment's thread
view the rest of the comments
[โ€“] mindbleach@sh.itjust.works 13 points 5 months ago (1 children)

When the standard for "robust" is Java--

[โ€“] BatmanAoD@programming.dev 7 points 5 months ago* (last edited 5 months ago)

I see where you're coming from, but no matter how many null pointer exceptions there are in Java code, you're almost always protected from actually wrecking your system in an unrecoverable way; usually the program will just crash, and even provide a relatively helpful error message. The JVM is effectively a safety net, albeit an imperfect one. Whereas in C++, the closest thing you have to a safety net, i.e. something to guarantee that invalid memory usage crashes your program rather than corrupting its own or another process's memory, is segfaults, which are merely a nicety provided by common hardware, not required by the language or provided by the compiler. Even then, with modern compiler implementations, undefined behavior can cause an effectively unlimited amount of "bad stuff" even on hardware that supports segfaults.

Additionally, most languages with managed runtimes that existed when Java was introduced didn't actually have a static type system. In particular, Perl was very popular, and its type system is...uh...well, let's just say it gives JavaScript some serious competition.

That said, despite this grain of truth in the statement, I think the perception that Java is comparatively robust is primarily due to Java's intense marketing (particularly in its early years), which strongly pushed the idea that Java is an "enterprise" language, whatever that means.