What FP taught me about OO: Liskov Substitution Principle explained

TL;DR – functional programming taught me that LSP is a special case of PLS: Principle of Least Surprise. One thing that bugs me while reading Java: I’m reading along, come to a method call, ctrl-click on the method name, and get a list of implementations of the interface. IntelliJ can’t tell me exactly what will …

Read moreWhat FP taught me about OO: Liskov Substitution Principle explained

From imperative to data flow to functional style

Functional style makes code more maintainable. How? One way makes processing into a flow of data with discrete steps. Another way separates flow from context, making the context swappable. This post illustrates both. We’ll go from an imperative style to a more and more functional style. Scala is a good language for this illustration, since …

Read moreFrom imperative to data flow to functional style