Functional Programming9 articles
There’s no support for the pipe operator |> in Kotlin, so we have to come up with a custom and clean implementation for this function.
Foojay Podcast #20: Functional Programming, “The Good, the Bad, and the Ugly”
Functional programming: you either love it or you hate it. But it is a trade-off. So for today, let’s focus on the good, the bad, the ugly!
The Problem with Functional Programming
Functional programming is amazing, although I think there are a few problems that prevent it from being used more.
Exceptions in Java Lambdas
Java streams don’t play well with checked exceptions. To recover the readability we expect of streams, we can rely on Apache Commons Lang.
On Cosmetics vs. Intrinsics in Programming
Instead of arguing about cosmetics, e.g., annotations vs. “functional”, we need to spend time on intrinsics more: actors, asynchronous, etc.
Handling Null: Optional and Nullable Types
Java is infamous for its NullPointerException: calling a method or accessing an attribute of an object that has not been initialized.
Playing practically with Stream API
Let’s learn java stream API with a few practical examples
Some, if not most, of our judgments regarding technology stacks come either from third-party opinions or previous experiences. Yet, we seem to be adamant about them!
This week, I learned about a nifty “new” feature of Optional that I want to share in this post. It’s available since Java 9, so its novelty is relative.
We start with a sequence to compute the total price of an order, for which it is nowadays more adequate to use streams instead of iterations.
Optional makes the code less readable! I believe that readability should trump code style every single time.
Fortunately, Optional offers a stream() method (since Java 9). It allows to simplify the functional pipeline. Functional code doesn’t necessarily mean readable code. With the last changes, I believe it’s both.