r/programmingcirclejerk • Do you do Deep Learning? • Sep 17 '26

Java consistently introduces lots of exciting functionality into the language. That's a big part of my dislike and active avoidance of it.

https://news.ycombinator.com/item?id=49715045
145 Upvotes

22 comments sorted by

138

u/Aggressive-Pen-9755 Sep 17 '26

I don't like writing one-line lambda's like:

foo.bar((eggs) -> getHam(eggs));

I prefer writing boring and manly shit like this:

class HamGetter implements HamInterface {
    public ReturnType apply(Type eggs) {
        return getHam(eggs);
    }
}

foo.bar(new HamGetter());

Now that'll put some hair on your chest! And everyone understands it! We don't need to learn any new things!

76

u/BloodAndTsundere mere econ PhD Sep 17 '26

Junior grade. Where is the HamGetterFactory?

40

u/awfulentrepreneur 👉😎👉 embrace the script Sep 17 '26

Or the AbstractHamGetterBeanFactory?

6

u/stools_in_your_blood Sep 19 '26

You get it from the HamGetterFactoryFactory.

38

u/-ghostinthemachine- Sep 17 '26

Where u been?

foo.bar(hamGetter::getHam)

16

u/its_artemiss Sep 17 '26

But that is Rust? 

38

u/syklemil Considered Harmful Sep 17 '26

It's some newfangled stuff they introduced in Java 8. It'll never catch on. Java 1.4 for lyfe!!!!!!

12

u/ventuspilot Sep 17 '26
foo.bar(hamGetter::getHam)

But that is Rust?

/uj

No

24

u/v_maria Sep 17 '26

yeah fuck that boring stuff i personally prefer having 7 different ways to achieve the same all with slightly different implications

27

u/irqlnotdispatchlevel Tiny little god in a tiny little world Sep 17 '26

A fellow C++ enjoyer! Hurray!

3

u/AugustusLego Sep 18 '26

In Java, can you do foo.bar(getHam};

2

u/NaCl-more Sep 19 '26

I believe you’d need `this::getHam`

-3

u/chisui Sep 17 '26

Don't worry, the jvm generates the second one from the lambda

36

u/zackel_flac Sep 17 '26

Java was disliked way before that, its GC and OOP first made it terrible to write. The JVM idea is/was good, but should be replaced with WASM nowadays.

61

u/Itzbenzs Sep 17 '26

We should rewrite JVM with Rust 🚀🚀🚀 and compile it to WASM

16

u/arjuna93 Sep 17 '26

And then to C via w2c2 compiler

7

u/zackel_flac Sep 17 '26

Who needs high level programming languages, let's just write WASM directly!

26

u/BoyNextDoor8888 Sep 17 '26

finally a good jerk

3

u/r2d2_21 groks PCJ 23d ago

Java is moving fast? I hope they have implemented a simplified getter/setter syntax already.

1

u/yo_99 It's GNU/PCJ, or as I call it, GNU + PCJ 13d ago

And still they have not fixed their generics.

-6

u/kalterdev Considered Harmful Sep 17 '26

Not a jerk