Code refactoring techniques, extract method, strategy pattern, strangler fig migration, incremental improvement, and safe transformation steps. Use when improving existing code quality, reducing technical debt, or planning migrations.
"Refactoring is the art of improving code without changing what it does -- small, safe, relentless steps."
if (user) {
if (user.isActive) {
if (user.hasPermission) {
doWork();
}
}
}
if (!user) return;
if (!user.isActive) return;
if (!user.hasPermission) return;
doWork();