-
Notifications
You must be signed in to change notification settings - Fork 55
[BackEnd_김성은]2주차 과제 제출합니다 #68
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
base: main
Are you sure you want to change the base?
Conversation
BaeJinho4028
left a comment
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주차 과제도 고생하셨어요:)
|
|
||
|
|
||
|
|
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.
생각보다 이런 줄넘김이나 네이밍 규칙같은 코드 컨벤션 잘 지켜주시면 좋습니다.
| private final String name; | ||
| private int distance; | ||
|
|
||
| public Car(final String name, int distance) { |
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.
매개변수에 final을 붙여주셨네요. 이유도 궁금합니다.
| public int getDistance() { return distance; } | ||
| public String getName() { return name; } |
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 void close() { | ||
|
|
||
| } |
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 RacingGame getInstance() { | ||
| if(defaultRacingGame == null) { | ||
| defaultRacingGame = new RacingGame(); | ||
| } | ||
| return defaultRacingGame; | ||
| }*/ |
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.
주석들은 차라리 지워주셔도 좋을 것 같습니다.
| @@ -0,0 +1,24 @@ | |||
| package message; | |||
|
|
|||
| public enum GameMessage { | |||
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.
이렇게 모으면 무슨 장점이 있을까요?
| try { | ||
| game.run(); | ||
| } | ||
| finally { | ||
| game.close(); | ||
| } |
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.
전역적으로 try-catch하면 어떤 장점과 단점이 있을지 생각해보시면 좋을 것 같습니다.
새로 pr할 때 브랜치를 만들어야하는걸 모르고 전부 푸시했다가 다시 커밋하고 푸시했습니다. 이전 pr의 커밋 봐주시면 감사하겠습니다