Ga naar de hoofdinhoud

Name the reason to change

Identify separate reasons to change inside a class, function, or module.

clean-code-principles5 min read

The move: name the reason to change before you name the new abstraction. What SRP is really protecting Single Responsibility protects change paths. When unrelated reasons to change share one module, a small request becomes risky because the reader cannot tell which behavior is intentionally coupled and which behavior merely accumulated there. How to spot the boundary Look for actors and policies. Finance changes tax rules. Product changes checkout copy. Platform changes retries and telemetry. If each group can reasonably ask for changes on a different calendar, the code should probably expose different seams. The trap Do not split by…

Read the full lesson

Sign up free: one personalized lesson every day, matched to your role and goals.

← Back to library

Neem contact op