Mike. J. Thompson wrote:They are there so you can reuse them, but I'm not sure it would be worth the effort to remove interfaces you already have.
Mike. J. Thompson wrote:I'm also in two minds as to whether it would actually better to have interfaces with names that fit into your problem domain. I think code might lose some clarity with the Java provided interfaces. I will have to see how code looks when it is using them.
Mike. J. Thompson wrote:In my opinion, if you have to comment the code then it probably isn't clear enough. In your example I would say that the comment gets in the way since it doesn't say anything that isn't obvious from the code.
If the lambda gets complicated enough that it requires a comment I think I will move it into a method with a descriptive name so it doesn't require a comment, and then use method references to pass it around.
Avor Nadal wrote:Every time that it detects a simple "for" loop, it recommends me to use a functional operation (for example, Map.stream ().forEach ()). I believe that it's exaggerated. I doubt that a Collection of less of 10 elements can benefit from that, Right?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:...a compiler can probably optimize far better than I can; but if that's the case: DO IT; don't warn me about it.
Avor Nadal wrote:Because I can't live in calm seeing so many warnings in my IDE, I believe that I will simply disable them :P .
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:Well, hopefully you can just disable those warnings, because there are plenty of others that are worth knowing about.
Winston
Winston Gutkowski wrote:PS: Aaaggh!
<rant>
Just looked at the Spliterator class and discovered that it has integer "characteristic" constants valued for OR-able sets. For a version 8 class? Hasn't Oracle heard about Enums and EnumSets? Or do they just not pay their developers enough to get good ones (or peers enough to do code reviews)?
</rant>
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions