Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BOOK] 실무로 통하는 클린 코드 - 막시밀리아노 콘티에리 / 한빛미디어 #227

Open
lepffm opened this issue Sep 16, 2024 · 0 comments
Labels
Milestone

Comments

@lepffm
Copy link
Owner

lepffm commented Sep 16, 2024

intro

실무로 통하는 클린 코드 Clean Code Cookbook
막시밀리아노 콘티에리 Maximiliano Contieri
한빛미디어 2024
ISBN

feelings

MAPPER
Model: Abstract Partial and Programmable Explaining Reality
모델은 부분적 추상화와 프로그래밍을 통해 현실을 묘사해야 함
6.9 무엇을 통해 어떻게 에 대한 우발적 구현을 숨긴다
hasPendingTask (X)
canMoveOn (O)
6.10 정규표현식 문서화하기
문자열 대신 작은 객체
val prefix , digit, space
val phoneRegex = Regex("^$prefix(?$digit$space?){6,14}$digit$")
6.14 올바른 오류 메세지 생성하기
선언적으로 예외 설명하기
예외를 설명할때는 오류가 아닌 비즈니스 규칙을 언급해야 합니다.
e.g) 숫자가 범위를 벗어났습니다 -> 숫자는 1~100 사이여야 합니다
7.2 도우미와 유틸리티 이름 변경 및 분리하기
UserHelper.getFullName / getCategory
-> FullNameFormatter , CategoryCalculator 
7.4 result 변수 이름 변경하기
결과의 의미. 모르겠다면 마지막 함수 호출과 동일한 이름으로 
7.7 추상적인 이름 변경하기
abstract, base, object, manager, generic, helper ... 
e.g) AbstractTransportation -> Vehicle 
7.11 basic/do 함수 이름 바꾸기
함수 wrapper 제거 -> use decorator
7.12 복수형 클래스 -> 단수
7.13 이름에서 Collection 제거
7.14 I, Impl 제거 
7.15 역할에 따라
expected, actual
7.18 data (X)  dataExist -> peopleNotFound
11.2 인수 grouping 
14. IF
14.1. 우발적 if 를 다형성으로 대체. 필수적 비즈니스 규칙은 대체하지 않는다
14.15 동등 비교 변경하기
instance.attr == 'xxx' 대신 instance.isXXX('xxx') 
14.16 hardcoded business rule redefine
if(condition){   preserve() } -> customer.preserveIfVip(condition)
19. Layer
is-a 는 합성.  behave-as-a 를 상속 관계로 판단할 것 

image

@lepffm lepffm added the Book label Sep 16, 2024
@lepffm lepffm added this to the IT milestone Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant