
핵심 요약
- Code is read far more often than it is written, so write for the reader
- Names should reveal intent so clearly that comments become almost unnecessary
- Functions should be small and do exactly one thing at one level of abstraction
- A comment is usually a confession that the code could not explain itself
- Leave every file a little cleaner than you found it, one small change at a time
이 비트의 내용
- Code is written for people
Picture a developer opening a file written two years ago by a colleague who has since left. Every variable is called data or temp, one function runs for 300 lines, and nobody dares to touch it.
- Names carry the meaning
The cheapest improvement you can make is a better name. A variable named d tells you nothing; a variable named daysSinceLastLogin tells you everything, and it removes the need for a comment.
- Small functions that do one thing
Martin's rule for functions is simple to state and hard to follow: they should be small, and then smaller than that. A function should do one thing, do it well, and do only that.
- Comments are not a fix
Many programmers are taught that good code is heavily commented. Martin pushes back.
- Tests make cleaning safe
Why do teams leave ugly code alone? Fear.
- 직접 적용해 보기
This week, pick the file you dread opening and rename three variables so their purpose is obvious without a comment. Find one long function and split out a single well-named piece, keeping behaviour identical, and run the tests before and after.
여섯 가지 방법으로 배우기
이 책을 위해 시각화, 마인드맵, 연습, 시나리오, 챌린지, 복습 기능이 준비되어 있어요.
내레이션 제공
Michael이나 Bella가 읽어주는 이 비트를 들어보세요.
퀴즈와 플래시카드
읽은 내용을 테스트하고 간격 반복으로 확실히 기억하세요.
Bits AI
보고 있는 책, 섹션, 퀴즈 질문에 대해 답변해 줍니다.





