Skip to Content
훌륭한 프로그래머 되는 법: 프로젝트와 팀을 성공으로 이끄는 선배 개발자의 노하우
book

훌륭한 프로그래머 되는 법: 프로젝트와 팀을 성공으로 이끄는 선배 개발자의 노하우

by 최원재, 강전희, 안재덕, 남윤화, 피트 구들리프
May 2016
Beginner to intermediate
438 pages
8h 46m
Korean
Hanbit Media, Inc.
Content preview from 훌륭한 프로그래머 되는 법: 프로젝트와 팀을 성공으로 이끄는 선배 개발자의 노하우
52
1
부
you.write(code) ;
해 대폭 단순화할 수 있다. 이러한 훈련은 코드가 아무리 변해도 실제 작동은 변하지 않는다는
사실을 증명하는 데 도움이 된다.
3.3
중복
불필요한 코드 중복은 사악하다. 이 같은 범죄 행위는 보통 잘라내기와 붙여넣기를 통해 발생
한다. 게으른 프로그래머는 반복되는 코드를 공통 함수에 넣기를 고려하는 대신, 에디터를 통
해 한 곳에서 다른 곳으로 물리적으로 복사하여 옮긴다. 붙여넣기를 한 코드에 약간의 변경이
더해질 때 죄악은 가중된다.
코드를 복사한다는 것은 존재하는 버그는 모두 복사하되 반복 구조는 숨긴다는 뜻이다. 한 부
분에서 일부의 버그를 잡았다 해도, 복사된 다른 부분에 같은 양의 버그가 그대로 남아 있다.
리팩토링은 중복된 코드를 하나의 함수로 만드는 일이다. 약간 다르지만 비슷한 코드가 있다
면, 다른 부분을 파악하여 하나의 함수에서 매개 변수로 분기 처리하자.
TIP
코드 일부를 복사하지 말자. 공통 함수에 모두 넣자. 다른 부분은 매개 변수를 사용하자.
이는 흔히
DRY
(
Don
’
t
Repeat
Yourself
: 자신을 반복하지 말라) 원리로 알려져 있다. 우리는
불필요한 중복이 없는
DRY
코드를 목표로 한다. 다만 비슷한 코드를 하나의 공통 함수에 넣으
면, 해당 함수를 사용하는 코드들은 긴밀한 결 ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’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
QuotationMarkI 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
QuotationMarkI’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
QuotationMarkI'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.
Mark W.
Embedded Software Engineer

You might also like

클라우드 네이티브: 클라우드 네이티브 애플리케이션을 설계, 개발, 운영하는 핵심 가이드

클라우드 네이티브: 클라우드 네이티브 애플리케이션을 설계, 개발, 운영하는 핵심 가이드

정원천, 보리스 숄, 트렌트 스완슨, 피터 야우쇼베츠

Publisher Resources

ISBN: 9788968482304