News for hackers. Stuff that matters.
Re:Modern Java – A Guide to Java 8 by mhaymo on Monday November 16, 2015 @06:29AM (#10573831)
> maps don't support streams

This is very misleading. There is not a #stream method on Map because Map supports three different streams:

    map.keySet().stream()
    map.values().stream()
    map.entrySet().stream()
Re:Modern Java – A Guide to Java 8 by winterbe on Monday November 16, 2015 @08:12AM (#10574189)
Thanks for your feedback. I've improved the section about maps to better reflect the capabilities of streaming maps:

https://github.com/winterbe/java8-tutorial/blob/master/READM...

Re:Modern Java – A Guide to Java 8 by hitekker on Monday November 16, 2015 @09:19AM (#10574530)
Thanks for your hard work here!

Side note: http://winterbe.com looks quite similar to angel.co. Or does angel.co look quite similar to your website? :-)

Re:Modern Java – A Guide to Java 8 by winterbe on Monday November 16, 2015 @11:08AM (#10575168)
Dunno. I wrote the whole css for winterbe.com from scratch. To be honest I don't find both pages like similar besides white background and gray subtitles. :-)
Re:Modern Java – A Guide to Java 8 by oweiler on Monday November 16, 2015 @07:54AM (#10574107)
Furthermore, Maps have a .forEach method

m.forEach((key, value) -> System.out.println("key: " + key + " value: " + value));

Re:Modern Java – A Guide to Java 8 by aslakhellesoy on Monday November 16, 2015 @08:45AM (#10574342)
Those methods are not on Map, but on Set and Collection.
Re:Modern Java – A Guide to Java 8 by tokenizerrr on Monday November 16, 2015 @06:39AM (#10573857)
But those are streams on sets.
Re:Modern Java – A Guide to Java 8 by mhaymo on Monday November 16, 2015 @06:48AM (#10573895)
Those are streams on views on the map. My complaint is that a reader seeing "maps don't support streams" with no further explanation is unlikely to get the correct idea, and may infer that something like

  map.entrySet().stream().filter(e -> e.getKey().equals(e.getValue())).findAny()
is not expressible.
Re:Modern Java – A Guide to Java 8 by masklinn on Monday November 16, 2015 @07:52AM (#10574095)
They're streams on map views, a stream on Map itself doesn't really make sense because there are multiple ways to interpret a map as a sequence and it's not clear what should be the default (e.g. Python defaults to the equivalent of keySet().stream(), but Rust defaults to entrySet().stream()).

keySet() and entrySet() return Set-conforming objects because they can, values() can't and only returns a Collection, but these three objects delegate much of their logic to the map itself.