2020 November

Java 8 streams, functions and reductions

There is a relatively simple challenge to extend the vowels in a string. Here is a way to do it in Java 8: In the above I’ve tried to make the code as short as possible while still ensuring it’s readable and conforming to the clean code rules. All of that could be written without… read more »

Reducing Streams in Java

Java 8 introduced streams, among other things, and one of my favourite features is the reduce() method. It combines a stream into a single method. Before Java 8 and streams, such a reduction had to be done with a loop like this: Now with Streams and reduce() it can be done as follows with a… read more »