Expressive code makes meaning visible in its structure and data representations. Instead of hiding behavior behind a void method such as reschedule(), it accepts a domain value and returns a domain result, reducing guesswork and codebase hunting. section 1.4
Making rescheduling explicit
A data-oriented refactoring turns reschedule into a function from FailedTask to RetryDecision. Pattern matching then returns RetryImmediately, ReattemptLater, or Abandoned directly, so the method's inputs, outputs, and alternatives are visible at a glance. section 1.4
Expressive code tends to:
- Expose domain semantics through meaningful types rather than implicit object state. section 1.4
- Shape methods as expressions that take data in and return data out. section 1.4
- Let data representations guide implementation and make valid alternatives visible. section 1.4
