Immutability by default

Mutable shared state is the root cause of most concurrency bugs. Default to immutable values; introduce mutability only where necessary:

  • Use let (Swift), val (Kotlin), const (JS/TS) by default
  • Prefer value types (structs, data classes) over reference types
  • Contain mutation behind clear boundaries (actors, StateFlow, useState)
version
1.0.0
platforms
kotlin, swift
tags
immutability-by-default
author
Mike Fullerton
modified
2026-03-27

Change History

Version Date Author Summary
1.0.0 2026-03-27 Mike Fullerton Initial creation