https://refactoring.guru/replace-error-code-with-exception
Replace Error Code with Exception
/ Refactoring / Techniques / Simplifying Method Calls Replace Error Code with Exception Problem A method returns a special value that indicates an error? Solution Throw an exception instead. Before int withdraw(int amount) { if (amount > _balance) { return
refactoring.guru
'개발정보 > C,C++' 카테고리의 다른 글
static 정적변수, 함수 (0) | 2021.07.25 |
---|---|
크기가 표시된 정수 자료형 (0) | 2021.07.25 |
void와 static void함수의 차이점 (0) | 2021.07.19 |
[C/C++]Data type (0) | 2021.04.29 |
[C/C++]구조체 태그의 의미, typedef이란 (0) | 2021.04.29 |
댓글