Left to right, top to bottom

TL;DR – Clojure’s threading macro keeps code in a legible order, and it’s more extensible than methods. When we create methods in classes, we like that we’re grouping operations with related data. It’s a useful organizational scheme. There’s another reason to like methods: they put the code in an order that’s easy to read. In … Read moreLeft to right, top to bottom

Continuation Style Without the Fugly

The previous post discussed advantages of using a continuation style to send our code to the data instead of making our code wait for the data to come back to it. This pseudocode example has three I/O operations, each encasing the operations which should follow in a callback function parameter. let filename = // calculate … Read moreContinuation Style Without the Fugly

The confluence of FP and OO

Michael Feathers has a great blog post up today about how object-oriented and functional programming styles are suited to different portions of an application. Specifically, the object-oriented style fits the high-level application components. The original intention of OO was for objects to pass messages to each other, which is suited to a SOA style and … Read moreThe confluence of FP and OO

Humility in programming languages

John Backus (pdf) distinguishes two parts of a programming language: “First, its framework which gives the overall rules of the system, and second, its changeable parts, whose existence is anticipated by the framework but whose particular behaviour is not specified by it.” The framework part is all the built-in language constructs. The changeable parts are … Read moreHumility in programming languages

Dependency Injection vs Functional

At work, we use dependency injection to build up small, decoupled classes each with a single responsibility. DI lets us assemble these in multiple different ways, so we can use the same class for similar processes. This strategy of combining small pieces of functionality in different ways is also a goal of functional programming. Let’s … Read moreDependency Injection vs Functional