An Introduction to Property-Based Testing with JavaScript

Property-based testing is a powerful technique that’s been widely and successfully applied to functional-style codebases for a long time. As functional programming continues to get more and more popular among JavaScript developers, the value of this style of testing is becoming more obvious to a wider audience. Read more on An Introduction to Property-Based Testing with JavaScript…

A Simpler Case for Functional Programming & “Elegant” Code

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 immediately clear what that word actually means in this context. Read more on A Simpler Case for Functional Programming & “Elegant” Code…

Using Decorators to Declaratively Extend Functions

The decorator pattern gained fame in the object-oriented world after being featured in the classic 1994 Gang of Four book, Design Patterns. Since then, it’s been used extensively in traditional object-oriented programming as an alternative to inheritance. What’s really going on behind the scenes though, is composition, which means decorators are also great for cleaning up some functional programming boilerplate.

We’re going to look at decorators in JavaScript, along with some proposed syntax sugar coming in ES2017 that will make it easier to use them. Read more on Using Decorators to Declaratively Extend Functions…

Building Better Board Games with Clojure and Gorilla REPL

A while back, my six-year-old daughter and I were on one of our regular daddy-daughter date nights when we decided to create a board game. We sat at a restaurant table with paper, crayons, and a small collection of Dungeons and Dragons trinkets. To my surprise, we built a fun little game that my daughter named Turtle Burglars.
Read more on Building Better Board Games with Clojure and Gorilla REPL…

4 Tips for Thinking Functionally

I’ve written before about why I prefer a functional programming paradigm to an object-oriented one, but it’s taken a long time to get there. I dabbled on and off for half a decade before the core ideas behind Clojure and Haskell really sank in and I could write code in my head without having to sit at a computer.

My relationship with functional programming may have been slow, but it was punctuated by several key insights. These deeply altered my approach to designing code, even code in non-functional programming languages.

Here are four habits that dramatically shifted my thinking toward functional programming.
Read more on 4 Tips for Thinking Functionally…


REPLs (Read-Eval-Print-Loops) are often billed as a great place to experiment and learn a language or a framework. They provide a very tight feedback loop. However, it can be difficult or time-consuming to extract the knowledge gained from a REPL and include it in your source code. I’ve hit the up arrow many times in Ruby’s pry, trying to find the specific input I wanted to copy. And don’t get me started on dealing with multi-line input. Thankfully, the developers behind F# came up with a clever way of dealing with this problem. Read more on TDD in a REPL…

Four Reasons to Use Maps Instead of Classes

I started my career back when Object-Oriented Programming was first becoming a dominant methodology, and boy, was OOP going to change the world. Encapsulation, inheritance, polymorphism—these tools promised to save the righteous from complexity, guarantee reusability, and decouple all the things!

So when I recently starting developing in Clojure, the suggestion to “just use maps to represent data” gave me pause—how could maps be better than objects? Heresy! I’ve since fallen in love with the approach, and would like to share four reasons why.

Read more on Four Reasons to Use Maps Instead of Classes…

RSchema-Hamster: Schemas for Shaping Immutable Data

RSchema-Hamster is a Ruby gem that lets you use Hamster’s persistent data structures to define and validate the shape of your data via RSchema.

What for?

In order to clarify my designs, reduce mistakes, and leave code easier to change than when I found it, I:

Read more on RSchema-Hamster: Schemas for Shaping Immutable Data…