News for hackers. Stuff that matters.
Re:What's new in Java 12, 13 and 14 by MaxBarraclough on Tuesday December 17, 2019 @10:45AM (#21814637)
> it makes every possible event explicit and stand-out

I agree that's nice to have - essentially announcing events as special in the type system.

> good for inline optimization

Any optimisation here should be possible with an ordinary implementation of the observer pattern, no?

> it also provides a standard, much more intuitive syntax using formal function delegate declaration

I'm not convinced that it does. Without events, we can still write:

    var h = () => { doStuff(); doOtherStuff(); };
    subject.registerObserver(h);
> Before having lambdas in Java, we need to add an EventListener as a variable and adding an extra interface

I suspect we're both right, then: events were introduced for a good reason, but now that C# has lambdas and such, they don't seem to add much.

Re:What's new in Java 12, 13 and 14 by jayd16 on Tuesday December 17, 2019 @11:52AM (#21815459)
I'd much rather use events than that snippet.