돼지들이나 자신의 오물 안에서 산다. 프로그래머들은 그럴 필요가 없다. 코드를 작성한 후에
는 스스로 정리하고 불필요한 코드는 즉시 제거하라.
이것이야말로 코딩 세계에서 로버트 마틴
Robert
Martin
6
의 충고를 따르고 ‘보이스카우트 규칙’에 경
의를 표하는 사례이다. 캠프장을 발견했을 때보다 더 깨끗하게 정리하라.
TIP
매일같이 코드를 더 좋게 만들라. 중복 코드는 발견 즉시 제거하라.
단, ‘정돈
tidying
up
’은 다른 기능적 변화와는 별개로 전개되어야 한다는 간단한 규칙에 유의하라.
그래야만 소스 관리 시스템에서 어떤 일이 일어났는지 명확히 이해할 수 있다. 기능적 수정과
불필요한 구조 변화가 섞여 있는 경우 불필요한 것들을 추적하기가 어렵다. 그리고 버그가 있
는 경우 그것이 새로운 기능 때문인지 아니면 구조적 문제 때문인지 찾아내기 훨씬 더 어렵다.
3.10
마치며
소프트웨어 기능은 코드의 줄(
line
) 수나 컴포넌트 수와는 연관이 없다. 더 많은 줄의 코드가
더 좋은 소프트웨어를 의미하지는 않는다. 따라서 필요하지 않다면 코딩하지 말라. 적게 쓰고
그 대신 더 재미난 것을 찾으라.
질문
1
간결한 논리적 표현을 사용하는가? 간결한 표현이 너무 간결하여 이해하기
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.