Skip to main content

Taming Concurrent Code - State Transitions vs Flows

· 7 min read

Concurrent code is everywhere. Anytime you have multiple operations that can take a little time and happen simultaneously, you've got concurrent code. If you are reading and writing files, interacting with a database, or handling user interactions in a UI, you may have to deal with concurrency issues. We're going to take a look at a couple programming patterns and see how they fit in with concurrency.

The Duality of State and Events

· 7 min read

Duality has different meanings in different domains, but the essential idea is that of 'two sides of the same coin'. There is one object, or one entity, and there are different ways of viewing it. The classic literature example is Dr. Jekyll and Mr. Hyde. One person, two different presentations of behavior.

Functional Core, Imperative Shell implemented with Finite State Transducers

· 6 min read

In a previous article we looked at Finite State Transducers (FSTs). To quickly recap, a Finite State Transducer is a type of Finite State Machine that also produces output. This technique for structuring your code can work well with many modern programming paradigms and patterns. In this article, we're going to see how it fits in with the Functional Core, Imperative Shell (FCIS) pattern.

Thinking in Finite State Transducers to Enhance Precision

· 8 min read

What is a Finite State Transducer? Your first guess might be that its an essential component of a car-based time machine, like a flux capacitor. It isn't, but believe it or not, we are going to travel back to 1955, have a chat with a George M, hopefully improve our lives in the present, and maybe even wrap a bulletproof vest around our code to protect it from unexpected disasters.