Tail recursion is a kind of recursion that won’t blow the stack, so it’s just about as efficient as a while loop. Unfortunately, not all platforms support tail call removal, which is necessary for making tail recursion efficient. We talk about what it is and how to do it, even if your language doesn’t support it.
Thoughts on Functional Programming Podcast
An off-the-cuff stream of Functional Programming ideas, skills, patterns, and news from Functional Programming expert Eric Normand.
Memoization is a higher order function that caches another function. It can turn some slow functions into fast ones. It saves the result of a function call after the first time to the cache, so if you call the function again with the same arguments, it will find it in the cache.
Often, functionality starts off as code. It’s if statements and imperative ideas. But, over time, you notice patterns. Those patterns can be reified as data. And that gives us tremendous power. How so? We explore it in this episode.
We continue this exploration with the notion that maybe practices such as Agile, Design Thinking, etc., give us a means for eliminating essential complexity that we thought was necessary. Do we really need to implement everything? Maybe not.
In The Mythical Man-Month, Fred Brooks argues that there is no improvement that can give us an order of magnitude increase in productivity. His main point is that most of what’s left to improve is essential complexity. But is that true? Can we throw in the towel and declare there is nothing left to improve?
Getters and setters kick the domain modeling can down the road. They leave the real design work to some other part of the code. They don’t do enough to protect the semantic integrity of the object. They’re terrible.
My book is called Taming Complex Software. What’s that all about? In this episode, I go into why complexity is a major problem and how functional programming can help.
In a recent episode, I said algebraic thinking was the third level of functional thinking. In this episode, I give some concrete examples.
Higher-order functions are used a lot in functional programming. They are functions that take other functions as arguments or return functions as return values, or both. You’ll probably be familiar with map, filter, and reduce, which are higher-order functions. In this episode, we go kind of deep on them.