Skip to content

Comments

5주차 미션 구현 완료(박종한)#3

Open
whdgks wants to merge 2 commits intoallrounder-backend:mainfrom
whdgks:main
Open

5주차 미션 구현 완료(박종한)#3
whdgks wants to merge 2 commits intoallrounder-backend:mainfrom
whdgks:main

Conversation

@whdgks
Copy link

@whdgks whdgks commented May 12, 2025

오류가 나서 GPT한테 물어보니 build.gradle 파일을 수정이 필요하다고 해서 수정했습니다.

Copy link
Contributor

@moongua404 moongua404 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5주차 미션 수고하셨습니다!
다음에는 패키지도 활용해보시면 좋을 것 같아요

sum = safeAdd(sum, value);
}
return sum;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

함수 볼륨이 좀 큰 것 같아요.
예외 처리 로직, 구분자 추출 로직, 연산 로직 이렇게 기능이 분리될 수 있으면 함수도 분리하는게 맞다고 생각합니다.

throw new IllegalArgumentException("오버플로우 발생");
}
return result;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오버플로우를 검출하며 계산하는 Math.addExact 라는 함수를 활용할 수 있을 것 같아요

if (custom.length() > 1) throw new IllegalArgumentException("구분자는 한 문자여야 합니다.");
delimiter = Pattern.quote(custom);
input = input.substring(newlineIdx + 2);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분도 regex를 사용하면 가독성이나 효율성 측면에서 더 좋을 것 같아요

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants