News for hackers. Stuff that matters.
Re:Fluent: Static Extension Methods for Java by misja111 on Monday July 03, 2023 @04:38AM (#36570341)
> Extensions are searchable by syntax

This would be very useful. But how are these extension methods more searchable by syntax than the 'old fashioned' static util methods? I admit I haven't tried, but I suspect that code completion in my IDE wouldn't include these extension methods.

Re:Fluent: Static Extension Methods for Java by sjrd on Monday July 03, 2023 @05:13AM (#36570570)
At least in Scala, code completion in the IDE does include available extension methods.
Re:Fluent: Static Extension Methods for Java by jdmichal on Monday July 03, 2023 @12:17PM (#36575095)
They're more discoverable, because typing in `object.` tells the IDE that you are looking for methods on the type of `object`. If the IDE is aware of extension methods, it can also expose them the same as instance methods.

Java specific: If you're looking for a static utility method, then `UtilClass.` will also autocomplete. However, what if the function you're looking for isn't in `UtilClass`, but `SomeOtherClass`? What if you don't even know whether a method already exists for what you're trying to accomplish, and it could possibly exist in multiple libraries? Your discoverability engine quickly becomes Google.