Re:Fluent: Static Extension Methods for Java
by hexmiles on Monday July 03, 2023 @05:21AM
(#36570624)
Can someone explain the rationale for not being able to call a static method on an instance?
A lot of programming language do this, I assume there is a reason, but I don't understand what it is.
[ Parent
| on HN ]
Re:Fluent: Static Extension Methods for Java
by rogerkeays on Monday July 03, 2023 @05:24AM
(#36570636)
You can call a static method on an instance. This project allows you to call static methods not defined within the instance's class.
And what’s the benefit of that? Except maybe you can chain it and it looks a bit nicer
Tab completion is much better w/ (extension) methods.
I would pay like, $10,000 of my own money for extension methods like this (actually like Kotlin or Swift) in Typescript. That would solve so many abstraction design problems for me!!