3 ms·
Streams are fine and Java is clearly evolving in a good direction but what makes me tear out my hairs is that they needed 7 years to add a toList() method to st
by jvmboi 3y ago
Streams are fine and Java is clearly evolving in a good direction but what makes me tear out my hairs is that they needed 7 years to add a toList() method to streams. This is so typical for the way that the Java language evolved. Ergonomics always came last with Java and if it's not clunky and painful to use at first then the Java stewards don't want it. Maybe in another 7 years we will get filter() and map() directly on Collection.
- samus 3y agoJava has always preferred introducing features late over introducing something that they later can't get rid off anymore. Whether something is truly useful can often be said only in hinsight. Streams are in the standard library after all. To enable more rapid iteration, it would have been smarter to place it in a separate package of a `jdk.*` module (like `jdk.httpserver`) for which weaker compatibility guarantees apply. But that would completely divorce it from the other collection classes. Fixing that would require adding extension methods to Java.
- jvmboi 3y agoIs it really a new feature to have the most traveled path be comfortable? I wouldn't agree. I think whoever is in charge of Java should be conservative and careful but what I would just wish is for them to give the developer experience some priority.
- smrtinsert 3y agoI'd rather they defer decisions until they are sure. Libraries came out immediately to help with verbosity complaints around streams. I'd rather each step they take be sure-footed.