4 ms·
wait, it's like https://projectlombok.org/features/experimental/ExtensionMethod https://projectlombok.org/features/experimental/ExtensionMet...
by _ZeD_ 3y ago
wait, it's like https://projectlombok.org/features/experimental/ExtensionMethod https://projectlombok.org/features/experimental/ExtensionMet...
- sam_lowry_ 3y agoThere are good reasons lombok ExtensionMethods never left the experimental status.
- zeedude 3y agoThey mostly have to do with design decisions / implementation details, not issues with extension methods in general.
- rogerkeays 3y agoI never saw the need for annotating extension methods like in Lombok or Manifold . Lombok is great for other stuff though.
- zeedude 3y agoThere are good reasons. When you begin writing IDE support you will discover that: 1. Without annotations you’ll be forced to index all static methods based on the first argument, globally. 2. Method call code completion will be ridiculous. How many static methods have String, File, List, Object(!) etc. as the first parameter? I don’t think anybody wants their code completion to be invaded like that. The annotations provide intention. Essentially, adding an extension method is not something to be taken lightly, it requires careful consideration, weighing context, frequency, etc.
- rogerkeays 3y agoIDEs are not my strong point. Aren't they smart enough to just search static methods in the scope of the compilation unit? Okay, so they have to be indexed first I suppose, but still... Ah, I suppose you want to search for methods you haven't imported yet. Now I get the annotation stuff. We're writing code for the IDE.
- zeedude 3y agoDing!