You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can tell that my IntelliJ (gently) warns me of places where anonymous class could be replaced by lambdas, and it can convert all of them in one pass.
I would help to do it but I don't think it's a clear cut that lambdas are better in terms of code readability (works for me, but it depends on many other cases).
I am not sure about such a brute force method: Using the diamond operator (for generics) for example was straight forward, but as you said: it is not always clear that you should use a lambda, even if it is possible.
I used to think that explicit inner classes was a good thing but as I worked more on Java8 code bases it became obvious that it wasn't needed very often and Lambdas tended to be quite clear.
So I would tend to prefer Lambdas unless it introduces exceptionally bad clarity (which is a judgment call I appreciate)
Activity
andimarek commentedon Apr 10, 2017
I am not sure about such a brute force method: Using the diamond operator (for generics) for example was straight forward, but as you said: it is not always clear that you should use a lambda, even if it is possible.
bbakerman commentedon Apr 11, 2017
I used to think that explicit inner classes was a good thing but as I worked more on Java8 code bases it became obvious that it wasn't needed very often and Lambdas tended to be quite clear.
So I would tend to prefer Lambdas unless it introduces exceptionally bad clarity (which is a judgment call I appreciate)
jimexist commentedon Apr 19, 2017
i could create a PR and let's see what's changed? @andimarek @bbakerman
jimexist commentedon Apr 19, 2017
#383