Blog

Articles, tutorials, and insights about functional programming in Java

Subscribe via RSS
How to Introduce Functional Programming into a Legacy Codebase

How to Introduce Functional Programming into a Legacy Codebase

Legacy systems do not need a rewrite to benefit from functional programming. The right approach is incremental: find the seams, wrap the dangerous parts, and grow functional islands outward. A practical guide for Java teams working with existing production code.

Pattern Matching and Domain Modeling

Pattern Matching and Domain Modeling

Sealed types make your domain states explicit and exhaustive. Pattern matching forces every caller to handle them all. Together they turn a class of runtime surprises into compile-time errors — and make the business model readable in the type signatures.

Lazy Evaluation: When It Helps and When It Complicates Things

Lazy Evaluation: When It Helps and When It Complicates Things

Lazy evaluation defers a computation until its result is actually needed. That single idea eliminates wasted work, enables safe default values, and defers heavy initialization — but it also introduces traps around side effects, debugging, and error timing that you need to know before reaching for it.

Higher-Order Functions Explained with Real Examples

Higher-Order Functions Explained with Real Examples

Higher-order functions are not just map and filter. They are the mechanism behind every composable pattern in functional programming — Strategy, Decorator, Policy, pipeline — explained through real backend Java code.

How to Write More Predictable Code with Functional Programming

How to Write More Predictable Code with Functional Programming

Predictable code is code you can understand without reading everything around it. Functional programming gives you three concrete tools to get there: pure functions, honest signatures, and immutable values.

dmx-fun 0.1.0 — Production Ready

dmx-fun 0.1.0 — Production Ready

0.1.0 is the first stable, production-ready release of dmx-fun: a battle-tested ecosystem of functional programming modules for Java backends, with first-class Spring Boot and Quarkus support.

When "Making It Functional" Actually Makes the Code Worse

When "Making It Functional" Actually Makes the Code Worse

Functional idioms improve code when applied to the problems they solve. Applied to problems they do not solve, they add ceremony, obscure intent, and hurt performance. This post catalogs the specific cases where the functional version is the worse version — and why.

Why Avoid Mutable State?

Why Avoid Mutable State?

The case against mutable state is not philosophical. It is a list of bugs that mutable state causes reliably, in every codebase, on every team. This post names them, shows what they look like in Java backend code, and demonstrates the concrete improvement that comes from eliminating each one.

Monads Without the Smoke and Mirrors: a Pragmatic Explanation

Monads Without the Smoke and Mirrors: a Pragmatic Explanation

Every monad tutorial starts with the definition and ends with confusion. This one starts with the problem — chaining computations that can fail, be absent, or produce multiple values — and arrives at the definition by accident.