All Posts

Fundamentals

Page 1 of 1

Closures and Variable Capture Explained for Java Developers

Closures and Variable Capture Explained for Java Developers

Java developers use closures every time they write a lambda that references a variable from the surrounding method — usually without naming what they are doing. This post explains what a closure actually is, what 'effectively final' really means and why the rule exists, and the capture pitfalls that bite people in loops and shared state.

Pure Functions and Side Effects

Pure Functions and Side Effects

A pure function always returns the same output for the same input and changes nothing in the world around it. That single rule — predictable output, no hidden changes — is the foundation that makes functional code easier to test, reason about, and refactor.

Algebraic Data Types Explained for Business Software Developers

Algebraic Data Types Explained for Business Software Developers

Algebraic Data Types sounds like a math lecture. It is actually a simple idea with a large practical payoff: two building blocks — AND and OR — that let you model business domains so precisely that illegal states cannot be represented in code at all.

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.

Common Mistakes When Learning Functional Programming

Common Mistakes When Learning Functional Programming

Most functional programming mistakes are not syntax errors — they are conceptual ones. This post catalogs the thinking traps that slow engineers down when first adopting FP: the wrong goals, the wrong scope, and the wrong order of learning.

Declarative vs Imperative: How the Mindset Changes

Declarative vs Imperative: How the Mindset Changes

Imperative code tells the machine what to do step by step. Declarative code tells it what you want. The gap between those two sentences is where most of the complexity in everyday Java code hides — and where the biggest readability gains are waiting.

Immutability in Java: An OOP Foundation

Immutability in Java: An OOP Foundation

Immutability is one of those ideas that sounds simple—an object doesn’t change after it’s created—but has surprisingly deep consequences for design quality, correctness, and long-term maintainability.