QDB: Quote #303942
Donate! About / Browse / Latest / Random / Queue / Prefs / Submit Quote / Search

This quote has been fermenting for 4 years and has been voted on 97 times.
Based on preliminary voting, this quote has a 74.6% chance of being approved.

#303942* (?/97) ⚐Flag
<fivre> Hello ladies. Look at your code.
<fivre> . return Iterables.filter(
<fivre> . . . . employees,
<fivre> . . . . new Predicate<Employee>() {
<fivre> . . . . . . public boolean apply(Employee e) {
<fivre> . . . . . . . . return e.isPartTime();
<fivre> . . . . . . }
<fivre> . . . . });
<fivre> Now look at mine.
<fivre> . return Iterables.filter(employees, {Employee e -> e.isPartTime()});
<fivre> Now back at your code.
<fivre> . return Iterables.filter(
<fivre> . . . . employees,
<fivre> . . . . new Predicate<Employee>() {
<fivre> . . . . . . public boolean apply(Employee e) {
<fivre> . . . . . . . . return e.isPartTime();
<fivre> . . . . . . }
<fivre> . . . . });
<fivre> Now back to mine.
<fivre> . return Iterables.filter(employees, {Employee e -> e.isPartTime()});
<fivre> Sadly, it isn't mine.
<fivre> But when it stops using inner-class-scented Java and switches to JDK 7, it could smell like mine.
<fivre> Look down. Back up. Where are you? You're in an IDE, with the code your code could smell like. What's in your hand? Back at me. I have it. It's a lambda expression, with two arguments of that type you love.
<fivre> Look again: the lambda is now a method reference!
<fivre> . return Iterables.filter(employees, Employee#isPartTime);
<fivre> Anything is possible when your code smells like fresh new JDK 7 hotness and not inner classes. I'm on a horse.
Subscribe to the RSS feed to get the latest approved quotes
About / Browse / Latest / Random / Queue / Prefs / Submit Quote / Search
0.007 (1) 14,278 quotes approved; 9,612 fermenting; karma: 189.7027