Round 1 feedback

Michael Nascimento misterm at gmail.com
Wed Jan 9 03:06:58 PST 2013


Hi guys,

So last Friday I spent some time migrating the code from a heavily
collection-based real world business project to JDK 8, as a way of
seeing how it would work in practice. This project used Guava all over
the place.

Besides all the emails I've sent so far, here are a few pieces of
extra feedback:

- Code reduction was significant. My co-workers who have seen the code
liked how well lambda is going;
- There are still several constructions that require generics to be
explicitly used, such as into(). Was not that the case, the reduction
would have been even greater;
- There were two legacy methods in this code base that relied wrongly
on double. When I changed the reduction to use parallelStream(), my
unit tests failed miserably, since operations like sum are not
commutative with doubles given their lake of precision. I guess this
will bite developers out there. Somewhere in javadoc it could be worth
mentioning how parallel execution might affect the output in this
case;
- The main transformation in the code base is taking an Entity and
turning it into a Map<T, Entity> (Maps.uniqueIndex in Guava). In the
binary drop that was available at that time, there was no easy way of
achieving that. Is there any now in b72?;
- The other main Guava uses that remained were Multimaps - and there
were many. Any plans to support them?;
- I was able to refactor parts of my code base in a way that wasn't
practical before by using Block in method signatures. Of course it
should be used wisely, but be ready to see this code smell spreading
everywhere with Java 8.

Overall, it was a very positive experience. I hope to continue with
this experiment in a few weeks.

Regards,
Michael


More information about the lambda-dev mailing list