3 ms·
Which new functional features? I'm not aware of any since Java 8 and those were pretty feeble. Java still doesn't offer Regex without having to escape metachara
by cutler 4y ago
Which new functional features? I'm not aware of any since Java 8 and those were pretty feeble. Java still doesn't offer Regex without having to escape metacharacters. That's how primitive it still is.
- e3bc54b2 4y agoEveryone's favourite subset of functional features is different, of course. I am still early in my career. I'm still discovering stuff for first time. I've also found that I am much more likely to use streams, lambdas, Optional and predicates in code compared to my more experienced colleagues. My functions tend to be pure more often, code has more interfaces than inheritance and generally more unit testable. One of the surprising moments was learning Elixir and realising I'm already doing the pipe thing in Java with Optional.map(). Java will never shed its OO skin but it is starting to grow FP muscles in the right places.
- ttfkam 4y agoFlow API (Reactive Streams) https://dev.to/ajiteshtiwari/java-9-flow-api-4e38 https://dev.to/ajiteshtiwari/java-9-flow-api-4e38 Collection factory methods https://openjdk.org/jeps/269 https://openjdk.org/jeps/269 Stream API improvements https://www.javatpoint.com/java-9-stream-api-improvement https://www.javatpoint.com/java-9-stream-api-improvement Honorable mention since not strictly functional, but makes code clearer and integrates well with functional patterns: pattern matching for switch statements https://openjdk.org/jeps/427 https://openjdk.org/jeps/427
- kaba0 4y agoSum types, records, type inference, so far very primitive pattern matching, but it has a very clear and great goal ahead. And these are only language level changes, the platform has expanded insanely significantly, but that also benefits clojure greatly (which is a good thing, it’s no competition)