Functional programming seems to be making its way into everything these days, and you can take advantage of it even if you’re not using a strictly functional language or toolset. The key is to think declaratively rather than imperatively.
Functional programming is a broad discipline, and this series has only scratched the surface. Like most skills, it is learned through practice. To help you practice, I’ve found a few ideas that are rooted in functional programming and may find a place in your next project. I’ve also collected a few functional languages that offer […]
Much of the power of functional programming is self-evident, but I wanted to spend some time exploring the reasons for and against using a functional style.
In functional programming, there are a lot of ideas and patterns that can make writing code a lot easier — most importantly pure functions, immutable state, and higher-order functions. I want to spend some time discussing these concepts and why they’re helpful in the context of functional programming.
Functional programming is a universally-applicable programming paradigm that yields clear code with evident effects, that is easier to debug and maintain. This functional approach has become popular in the software world, and I wanted to do my best to provide a thorough introduction. Here’s what you can expect: Fundamental functional programming concepts and basic examples […]
About a year ago, I was learning how to properly unit test Phoenix applications using the Mox library. The strategy I adopted for my side projects involves adding “module dependencies” to any module I want to unit test, and then using Mox to configure those dependencies during the tests. While that approach is great for […]
I’ve been working in F# lately, and one of its smaller features has had a big impact on my programming style: Variables are immutable by default. If you want to change something, you have to declare it mutable. Sometimes, this is what I naturally reach for, and the language rubs my nose in it. Here’s […]
As the ecosystem for Elixir matures more and more, there are some libraries that seem particularly promising to me. One of them is Mox, a simple but powerful library for implementing mocks for predefined behaviours (note the British spelling!).
A lot has been written about the benefits of functional programming, but little of it is accessible to a newcomer. Some of the benefits are easy to understand from an inexperienced perspective (e.g. “it makes concurrency easier”), but others are pretty nebulous. Chief amongst the inscrutable properties of functional programming is its “elegance.” It isn’t […]