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.
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
[2주차] 객체 지향 코드 연습(qwejiung) #14
base: main
Are you sure you want to change the base?
[2주차] 객체 지향 코드 연습(qwejiung) #14
Changes from 1 commit
ecf2005
34260f1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Bank클래스가 두개이신데 사용하지 않으시면 삭제하는 것이 좋습니다
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.
자료구조를 직접 변수명으로 만드는 것은 좋지 않습니다. 아래와 같이 변경하는 것은 어떨까요?
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 키워드를 사용해 변경되지 않을 인스턴스라는 것을 명시해야 합니다.
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.
메소드명을 더 구체적으로 작성해야 할 것 같습니다.
어떤 Account를 생성하는지 명시해줘야 합니다.
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.
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.
자바 Stream을 사용하는 것이 가독성 부분에서 훨씬 좋습니다.
Stream에 대해 공부해보시고 적용해보세요
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.
예외를 발생시켜 처리해주는 것이 좋습니다
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.
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.
반복문이 중첩되는 것은 수행 시간이 길어지고 곧 성능이 저하되는 것을 의미합니다.
가독성도 좋지 않기 때문에 다른 방법, 메소드 분리를 해주세요.
ex) 계좌 찾는 메소드 실행 -> 찾은 계좌 입금 및 출금
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.
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.
코드 컨벤션을 지킴으로써 가독성을 높여야 합니다
if문 안에 한 줄의 코드라도 괄호로 감싸주는 것을 추천드립니다
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.
반복문과 가정문이 3번 중첩되었는데, 가독성 측면에서 매우 좋지 않습니다.
메소드를 분리해주세요.
거의 대부분의 경우 1depth(1번사용)로 해결이 가능합니다.
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.
else if보다 early return 패턴을 찾아보시고 사용하는 것이 좋습니다
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.
사용자는 데이터를 직접 입력할 수 없는 것인가요?
사용자가 입력할 수 있도록 해야 할 것 같습니다
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.
한 칸만 줄바꿈 하는 것이 좋습니다
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.
인터페이스가 두 개 입니다..
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.
1000은 어떤 숫자를 의미하는 것인가요? 또한 0은??
상수를 구체적으로 설명해주는 변수 선언이 필요할 것 같습니다
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.
else if 를 반복해서 사용하는 것은 매우 좋지 않은 방법입니다.
Switch문을 사용해보세요. Enum클래스를 활용하는 방법도 있습니다!
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.
targetAmount도 Bigdecimal로 생성하는 것이 좋지 않을까요?
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.