Open
Conversation
BaeJinho4028
left a comment
There was a problem hiding this comment.
코드는 깔끔하게 잘 짜셨습니다.
아쉬운 부분만 집어보자면
- 줄넘김, 코드 규칙이 꽤 난잡한 것 같습니다.
- 불필요한 주석이 많으면 오히려 가독성을 해칩니다.
클린코드가 왜 중요한지, 어떻게 해야 클린코드를 짤 수 있을지 한번 고민해보시면 좋겠습니다.
백엔드가 아니더라도 어느 곳에서든 쓰이니까요. 2주차 과제도 고생하셨어요:)
Comment on lines
+8
to
+10
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
생각보다 이런 줄넘김이나 네이밍 규칙같은 코드 컨벤션 잘 지켜주시면 좋습니다.
| private final String name; | ||
| private int distance; | ||
|
|
||
| public Car(final String name, int distance) { |
Comment on lines
+24
to
+25
| public int getDistance() { return distance; } | ||
| public String getName() { return name; } |
Comment on lines
+34
to
+36
| public void close() { | ||
|
|
||
| } |
Comment on lines
+21
to
+27
|
|
||
| /*public static RacingGame getInstance() { | ||
| if(defaultRacingGame == null) { | ||
| defaultRacingGame = new RacingGame(); | ||
| } | ||
| return defaultRacingGame; | ||
| }*/ |
| @@ -0,0 +1,24 @@ | |||
| package message; | |||
|
|
|||
| public enum GameMessage { | |||
Comment on lines
+15
to
+20
| try { | ||
| game.run(); | ||
| } | ||
| finally { | ||
| game.close(); | ||
| } |
There was a problem hiding this comment.
전역적으로 try-catch하면 어떤 장점과 단점이 있을지 생각해보시면 좋을 것 같습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
새로 pr할 때 브랜치를 만들어야하는걸 모르고 전부 푸시했다가 다시 커밋하고 푸시했습니다. 이전 pr의 커밋 봐주시면 감사하겠습니다