"매 check in 한 코드 의 check out 한 코드 보다 cleaner 의 leave.". Robert C. Martin (Clean Code, 2008) 의 popularize — 매 boy scout motto "leave the campsite cleaner than you found it" 의 software 의 apply. 2026 modern context 는 매 LLM-assisted refactor (Claude, Cursor) 의 cost 의 dramatic 의 lower — 매 rule 의 practice 의 ever-easier.
매 핵심
매 핵심 아이디어
매 touch 한 file 에 매 small improvement.
매 variable rename · dead code 의 delete · 매 magic number 의 const · 매 function 의 split.
매 commit 의 scope 의 keep small — 매 unrelated cleanup 의 separate commit.
매 왜
Entropy 와 fight: 매 code 의 자연 의 decay — 매 active counter-force 의 필요.
Compound interest: 매 small fix × N developer × M commit = 매 substantial improvement.
Cognitive load 의 lower: 매 next reader 의 효과.
매 응용
매 PR 의 작은 cleanup 의 같이 include (그러나 main change 의 separate commit).
매 LLM 의 통한 매 mechanical refactor 의 batch.
매 lint/format 의 pre-commit 의 enforce — 매 baseline 의 raise.
💻 패턴
매 commit 의 separate (git)
# Main change
git add src/feature.ts
git commit -m "feat: add export to PDF"# Boy scout cleanup
git add src/utils.ts # 매 touched file 의 cleanup
git commit -m "refactor: extract date formatter, rename ambiguous vars"
매 magic number 의 const 의 promote
// Before
if(user.failedAttempts>5)lockout(user);// After
constMAX_FAILED_LOGIN_ATTEMPTS=5;if(user.failedAttempts>MAX_FAILED_LOGIN_ATTEMPTS)lockout(user);
언제: 매 file 의 read 한 후 매 "이 file 의 small improvement 5개 의 suggest" — 매 LLM 의 human eye 보다 빠르게 spot.
언제 X: 매 critical path · 매 high-stakes module — 매 unintended behavior change 의 risk.
❌ 안티패턴
Big bang refactor: 매 PR 매 unrelated cleanup × 50 — 매 review 의 impossible.
Drive-by style change: 매 team convention 의 무시 한 personal preference.
Cleanup commit 매 mix: 매 main change 와 cleanup 의 same commit — 매 git blame 의 noise.
Test 의 break: 매 cleanup 의 behavior 의 change — 매 test 의 guard.
Scope creep: 매 5분 cleanup 매 2시간 rabbit hole — stop · ticket · commit.
🧪 검증 / 중복
Verified (Robert C. Martin Clean Code ch1; Kent Beck Tidy First? 2024).