r/ProgrammerHumor • • Jun 12 '25 • This 3

Meme andJavascriptForWeb

Post image
7.9k Upvotes

270 comments sorted by

View all comments

154

u/Rebrado Jun 12 '25

What is with all the Java hate?

406

u/Attileusz Jun 12 '25

Java has a culture of fully drinking the OOP coolaid. It also has a lot of outdated stuff in the language, this is made worse by a lot of places using outdated versions.

Using Java's more recent versions and using OOP as a tool in your toolbox, rather than the end-all be-all, Java becomes a completely fine and portable language with mature tooling.

Java to me is completely unremarkable. Not too fast, not too slow, no novel concepts. Just a language with generics, OOP and a garbage collector.

49

u/Rebrado Jun 12 '25

Thank you for the serious answer, this is what I was looking for.

46

u/Stagnu_Demorte Jun 12 '25

Using Java's more recent versions and using OOP as a tool in your toolbox, rather than the end-all be-all, Java becomes a completely fine and portable language with mature tooling

This, right here, is how I use the language. I think that regardless of how you feel about OOP as a whole you probably hate inheritance when it's used too much. Definitely the tool added by OOP that should be used sparingly.

→ More replies (1)

63

u/LickingSmegma Jun 12 '25 edited Jun 12 '25

OOP has the side effect that the IDE knows the structure of the app and can refactor it every which way. Whereas on the other end of the spectrum, with the dynamic nature of JS and Python the IDE can't be sure whether the objects' structure is modified at runtime and thus what's referenced by any identifier.

P.S. JavaScript coders have the habit of saying that IDEs are unnecessary, which is probably because they never saw the extent to which the IDE knows about a non-dynamic language.

30

u/RizzlaPlus Jun 12 '25

Think he meant avoid insanely big inheritance structures.

4

u/hedgehog_dragon Jun 12 '25

Maybe Javascript is a bad comparison, but I don't see that as any worse than JS passing a couple dozen parameters through multiple files which I'm seeing regularly these days. Huge pain in the butt when I'm trying to find where something is actually managed or used. Maybe my company just has bad JS code though.

20

u/chethelesser Jun 12 '25

I don't think it's a property of an OOP language, just a language with static types

→ More replies (1)

9

u/clickrush Jun 12 '25

JS (and Python as well as far as I can tell) is much more Object Oriented than Java.

The benefit you describe comes from static typing, not from OO.

2

u/LickingSmegma Jun 12 '25

They may be inside. But you can write JS and Python without ever bothering with organizing code into OOP, whereas you can't with Java. That's what matters for the IDE.

Also, JS objects are more of glorified maps that have some conventions for handling calling of methods — same way as with Lua tables.

→ More replies (4)
→ More replies (4)
→ More replies (5)

5

u/cheezballs Jun 12 '25

I think your point about it being sorta a middle of the road language is why it's so popular. I mean, it being one of the earlier "run anywhere" languages was huge, but Java also hasn't changed that much since its inception. We've got new features but they use the ugly java verbose syntax, making it feel like it's not as modern as it is.

3

u/Flannel_Man_ Jun 12 '25

And a lot of battle tested libraries

2

u/stipulus Jun 12 '25

I didn't realize people didn’t like oop. This explains why js libraries are so weird then. They'll do anything to avoid creating a contained, portable model with packaged functions. It's like no one really even paid attention in college or just went to 6 month programs where they tell you mvc is god and must not be questioned, even though no framework follows it completely.

2

u/Attileusz Jun 12 '25

OOP is a tool that basically gives you infinite opportunity to abstract. This is not healthy for all situations. It can abstract into the "wrong direction".

As a data oriented design enjoyer, I'm more fond of the ECS pattern, which usually means my classes usually don't do much inheritance, if any, and their methods are just operations on their data, with no other side effects, or simple query methods, who's result only depends on the contained data. This design philosophy allows for encapsulation, but doesn't really need liskov substitution, it also makes managing memory easy, which makes OOP (builtin vtable support) and garbage collection kind of moot points imho.

I'm not claiming this is one-size-fits-all (kind of unwieldy for large, unique, and heterogenous datatypes), but it's a nice and efficient pattern for a lot of cases.

→ More replies (3)
→ More replies (20)

50

u/Scotsch Jun 12 '25

It’s the “cool” thing to do. Most haven’t actually even used it outside a classroom or in the past 15 years

21

u/Esseratecades Jun 12 '25

People hate Java because it forces OOP on you and it's quite verbose.

However what I find very funny is that mature codebases using mature programming languages trend towards Java-esque syntax and paradigms anyway.

When JavaScript, which at the time had one of the most anti-traditional and anti-OOP programming communities, came out with Typescript and everyone fell in love with it, that said everything you need to know about how unfamiliar a lot of people are with the stuff they allegedly hate.

But then again most programmers form their opinions about tools based on nothing but a single to-do app so this shouldn't really come as a surprise.

15

u/_oohshiny Jun 12 '25

People hate Perl because you can write

    ''=~(        '(?{'        .('`'        |'%')        .('['        ^'-')
    .('`'        |'!')        .('`'        |',')        .'"'.        '\\$'
    .'=='        .('['        ^'+')        .('`'        |'/')        .('['
    ^'+')        .'||'        .(';'        &'=')        .(';'        &'=')
    .';-'        .'-'.        '\\$'        .'=;'        .('['        ^'(')
    .('['        ^'.')        .('`'        |'"')        .('!'        ^'+')
   .'_\\{'      .'(\\$'      .';=('.      '\\$=|'      ."\|".(      '`'^'.'
  ).(('`')|    '/').').'    .'\\"'.+(    '{'^'[').    ('`'|'"')    .('`'|'/'
 ).('['^'/')  .('['^'/').  ('`'|',').(  '`'|('%')).  '\\".\\"'.(  '['^('(')).
 '\\"'.('['^  '#').'!!--'  .'\\$=.\\"'  .('{'^'[').  ('`'|'/').(  '`'|"\&").(
 '{'^"\[").(  '`'|"\"").(  '`'|"\%").(  '`'|"\%").(  '['^(')')).  '\\").\\"'.
 ('{'^'[').(  '`'|"\/").(  '`'|"\.").(  '{'^"\[").(  '['^"\/").(  '`'|"\(").(
 '`'|"\%").(  '{'^"\[").(  '['^"\,").(  '`'|"\!").(  '`'|"\,").(  '`'|(',')).
 '\\"\\}'.+(  '['^"\+").(  '['^"\)").(  '`'|"\)").(  '`'|"\.").(  '['^('/')).
 '+_,\\",'.(  '{'^('[')).  ('\\$;!').(  '!'^"\+").(  '{'^"\/").(  '`'|"\!").(
 '`'|"\+").(  '`'|"\%").(  '{'^"\[").(  '`'|"\/").(  '`'|"\.").(  '`'|"\%").(
 '{'^"\[").(  '`'|"\$").(  '`'|"\/").(  '['^"\,").(  '`'|('.')).  ','.(('{')^
 '[').("\["^  '+').("\`"|  '!').("\["^  '(').("\["^  '(').("\{"^  '[').("\`"|
 ')').("\["^  '/').("\{"^  '[').("\`"|  '!').("\["^  ')').("\`"|  '/').("\["^
 '.').("\`"|  '.').("\`"|  '$')."\,".(  '!'^('+')).  '\\",_,\\"'  .'!'.("\!"^
 '+').("\!"^  '+').'\\"'.  ('['^',').(  '`'|"\(").(  '`'|"\)").(  '`'|"\,").(
 '`'|('%')).  '++\\$="})'  );$:=('.')^  '~';$~='@'|  '(';$^=')'^  '[';$/='`';

and it be a valid program; doesn't mean all Perl looks like that.

3

u/BlurredSight Jun 12 '25

Eval-group not allowed at runtime, use re 'eval' in regex m/(?{eval"\$==pop||99;--\$=;sub

_\{(\$;=(\$=||No).\" bottle\".\"s\"x!!--\$=.\" of beer\").\" on the wall\"\}print+_,\",.../ at main.pl line 22.

...Program finished with exit code 255

6

u/wdahl1014 Jun 13 '25

it forces OOP on you and it's quite verbose.

This is why I like java

→ More replies (6)

8

u/PhatOofxD Jun 12 '25

Java is fine.

More modern languages (.Net, Go, TS) are just better than fine. People prefer the nicer ones. Java is fine though. Will earn you a good living.

→ More replies (3)

11

u/Maskdask Jun 12 '25

Have you tried a modern language?

→ More replies (2)

3

u/CirnoIzumi Jun 12 '25

Java was made to solve OOPs portability and performance issues, not to be ergonomic.

3

u/Much-Pomelo-7399 Jun 13 '25

Apart from enums and interfaces, it's at best ugly and at worst confusing, verbose and clunky and often unintuitive to use. It's also frustrating to configure properly at times.

It's also slower than C (and its derrivatives) due to running on a VM.

Better than PHP tho.

2

u/RayquazaTheStoner Jun 13 '25

I’m a simple man with probably a simple take. It’s too wordy with its syntax and I also don’t care for “forced” OOP like Java and C#

C++ is bae

2

u/anonhostpi Jun 13 '25 edited Jun 13 '25

It is no longer the most ergonomic language for its designed use cases.

Especially, not enterprise Java. C# is significantly more ergonomic for that application. C# also has a lower skill requirement, if you realize you can train Systems Engineers/Admins on it by making them use it in their PowerShell scripts (PowerShell can embed and interact with C# and the C# type system comparable to the way that Python can interact with C/C++/Rust through ctypes)

If you would like proof, I'm a former sys ad. Look at the first 2 badges in my flair.

→ More replies (11)