-
Notifications
You must be signed in to change notification settings - Fork 7
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
[10주차] nyj #60
base: nyj
Are you sure you want to change the base?
[10주차] nyj #60
Conversation
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.
gitigonre
에 build, gradle 폴더도 추가해주세요
- 공통적으로 코드에 마지막 줄이 없는 경우가 있습니다
이 또한 컨벤션이니 맞춰주세요 - 요구사항인
for
->stream
변환이 빠진 부분이있습니다.
드린 피드백 반영하여 재리뷰 요청 부탁드립니다.
|
||
ResultView.printResultTitle(); | ||
|
||
for (int i = 0; i < gameNumber; i++) { |
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.
for문을 stream으로 바꿔보세요
|
||
for (int i = 0; i < gameNumber; i++) { | ||
ResultView.printResultPosition(cars.run()); | ||
System.out.println(); |
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.
여기서 수행해야할 코드일까요?
|
||
public static List<String> inputCarName(){ | ||
System.out.println("경주할 자동차 이름을 입력하세요.(이름은 쉼표(,) 기준으로 구분)"); | ||
return Arrays.asList(SCANNER.nextLine().split(",")); |
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.
매직 넘버란 코드 안에 작성된 구체적인 숫자 혹은 문자열을 말합니다. 그리고 매직 넘버의 단점은 아래와 같습니다.
- 의미를 이해하기 어렵다.
- 복수의 장소에서 사용된다면 변경하기 힘들다.
그런 매직 넘버는 의미를 나타낼 수 있는 상수로 치환하여 코드의 가독성을 높여 보는 것은 어떨까요?
} | ||
|
||
public List<Car> run() { | ||
for (Car car: cars) { |
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.
for -> Stream
@@ -0,0 +1,22 @@ | |||
package utils; | |||
|
|||
public class CarNameValidator { |
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
추출 👍
No description provided.