31. MVC 탈출기
MVC MVVM
UIViewController 라는 개념은
Business Logic 과 View가 혼합되기 쉬움
Cocoa framework 의존도를 최대한 줄이고
Pure 하게 Business Logic을 보존
ViewModel은 View를 몰라도 되는 장점
RxSwift
WHY
?
32. MVC 탈출기
•적절한 시점의 의존성 주입
•View 자체에 대한 dependency를 최소화
ViewModel
ViewController
/
View
ViewBindable
Model
60. Swift 버전업
Swift 4.0 Swift 5.0Swift 3.0
2016-09-13 2017-09-19 2019-03-25
버전을 거듭하는 변화 속에서 클린코드에 대한 고민을 엿볼 수 있습니다
61. Swift 버전업
SE-0235 Add Result to the Standard Library
•유연성이 부족한 기존의 error-handing 방식(throws, try-catch문)을 개선
•타 언어의 error-handing 방식, 특히 Swift 커뮤니티에서 일반적으로 사용되던 유형
65. 마춤뻡봇에서 SwiftLint까지
“클린코드” 에 대한 훌륭한 정의들은 이미 존재합니다
I like my code to be elegant and efficient. The logic should be straightforward to make it hard for bugs to hide,
the dependencies minimal to ease maintenance, error handling complete according to an articulated strategy,
and performance close to optimal so as not to tempt people to make the code messy with unprincipled
optimizations. Clean code does one thing well.
Bjarne Stroustrup
Clean code can be read, and enhanced by a developer other than its original author. It has unit and
acceptance tests. It has meaningful names. It provides one way rather than many ways for doing one
thing. It has minimal dependencies, which are explicitly defined, and provides a clear and minimal API.
Code should be literate since depending on the language, not all necessary information can be
expressed clearly in code alone.
Dave Thomas
You know you are working on clean code when each routine you read turns out to be pretty
much what you expected. You can call it beautiful code when the code also makes it look like
the language was made for the problem.
Ward Cunningham
66. SummarySummary
간결하고 읽기 쉬워야 하며, 객체 지향적, 함수명은 직관적,
행동을 명시하는 것이 좋고, 하나의 일을 할 것. 즐겁게 읽히
고 효율적이며 한 가지에 집중하는 코드. 타인이 수정하기
쉬워야 하고 테스트가 가능하며 간결하고 세련된 코드. 중복
이 없고 빠른 추상화로 프로젝트 진행이 신속할 것. 읽고 납
득이 되고 다음 코드로 넘어갈 수 있는 코드. Class, Struct
도 마찬가지, 재사용이 가능해야 하며 testable 한 코드, 목
적이 명시적이고 자연스럽게 읽히며 타인이 읽어도 이해가
쉽고 스스로가 나중에 읽어도 알기 쉬운 그런 유노왓암쌩?