-
Notifications
You must be signed in to change notification settings - Fork 200
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
[코드 리뷰용 PR입니다!] - 재구현 스터디 #234
base: main
Are you sure you want to change the base?
Conversation
|
||
<br><br> | ||
|
||
## 프로그래밍 요구 사항 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분 체크리스트도 확인해보시는 것도 좋을 것 같아요!
마지막 제출 전 확인 필수!
import racingcar.util.Constants.MIN_COUNT_NUMBER | ||
import java.lang.IllegalArgumentException | ||
|
||
object Validator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1주차와 마찬가지로 전체적으로 requre()
문을 사용하는 것이 더 좋아보여요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
테스트도 모듈별로 나눠서 하면 더 가독성이 좋아질 것 같습니다!
|
||
fun validateUnique(numberList: List<String>) { | ||
val validation = numberList.toSet() | ||
if (validation.size != numberList.size) throw IllegalArgumentException(ExceptionMessage.INVALID_UNIQUE_NAME.getMessage()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
중요한 것은 아닐 수도 있는데, 2주차 피드백에 보면 변수명에 자료형은 사용하지 않는다라는 내용이 있습니다. 저도 잘 지키지는 못하는 부분중에 하나인데 혹시 다음번에도 리팩토링을 더 하실 계획이 있다면 도움이 되지 않을까 싶어서 남깁니다:)
fun getInputCarNames(): List<String> { | ||
val input = separateNameByComma(getUserInput()) | ||
validateLength(input) | ||
validateUnique(input) | ||
validateNotNull(input) | ||
return input | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validator.kt내의 함수명들을 직관적으로 잘 지어주셔서 만약 위에 파일을 읽지 않았더라도 getInputCarNames에서 어떤 것들을 검증하는지 이해하기 편할 것 같네요!
No description provided.