Skip to content
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

[5기]3주차 Wordle 과제 제출 - 치즈 #30

Open
wants to merge 45 commits into
base: main
Choose a base branch
from

Conversation

ycheese
Copy link

@ycheese ycheese commented Jun 16, 2024

진행 방식

  • 페어 : 치즈, kr
  • 20분 마다 드라이버/네비게이터 교체
  • 테크 살롱 오프라인 1회, code with me + 게더 2회

잘한점

  • 단순히 기능 구현에 몰두하지 않고 서로의 코딩 철학에 대한 의견을 나누면서 인사이트를 얻었습니다.
  • 페어 프로그래밍과 테스트 코드 작성이 익숙하지 않으신 kr님께 단기 속성으로 제가 아는 지식을 공유해드렸습니다.
  • 구현을 하면서 꼭 서로의 의견을 묻고 합의점을 찾아나가려고 노력했습니다.
  • 반대되는 의견도 서로 거리낌없이 이야기할 수 있는 편한 분위기를 만들고자 했습니다. 덕분에 상호보완적인 페어프로그래밍을 할 수 있었습니다.
  • 시간 가는줄 모르고 재밌게 작업했습니다. 역시 재미가 중요하죠 !

아쉬운점

  • 페어 횟수가 적고 시간적 여유가 없다 보니 코드 퀄리티를 챙기기보다는 페어로 코딩을 하는 데 집중했습니다.
  • 설계 없이 얼렁뚱땅 코드를 짰고 이를 개인적으로 리팩토링하지 못했습니다.
  • 테스트 코드 작성을 늦게 시작해서 테스트하기 쉬운 코드를 작성하지 못했습니다.

어려웠던점

  • code with me를 처음 사용해봐서 어려움이 있었습니다. 둘이 같이 작업한 파일도 나눠서 커밋을 해야 하는 경우도 있었고, 종종 인텔리제이가 먹통이 되는 현상이 있어서 애먹었습니다.
  • green 타일이 나온 글자가 다른 위치에도 있는 경우에 대한 처리를 깨끗한 코드로 작성하는 부분이 어려웠습니다. 안 풀릴 때에는 과감히 제쳐두고 먼저 할 수 있는 작업을 했습니다. 역시 어려운 문제는 생각할 시간을 갖는 것이 도움이 될 때가 많습니다.

ycheese added 30 commits June 9, 2024 14:30
Copy link

@samkimuel samkimuel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

안녕하세요 치즈님! 리뷰를 맡게된 싸무엘입니다.
제가 과제를 진행하면서 고민했던 부분과 궁금한 점, 개선해보면 좋을 것 같은 부분을 코멘트로 남겨드렸어요.
코멘트에 대한 의견, 궁금한 점이 있다면 말씀해주시고, 제가 잘못 알고 전달드린 부분있다면 알려주세요!
바쁘신 와중에 과제하시느라 고생 많으셨습니다! 👍🏻👍🏻 계속 같이 파이팅해요💪🏻


public class AnswerProvider {

private static final LocalDate REFERENCE_DATE = LocalDate.of(2021, 6, 19);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WordleGameConfig 클래스가 게임 규칙 관련한 상수를 모아놓은 역할이라고 이해했어요.
그래서 이 상수도 게임 규칙 관련한거라 WordleGameConfig 에 포함되면 좋을 것 같다고 생각하는데, 혹시 WordleGameConfig에서 관리하지 않고 따로 분리하신 이유가 있을까요?? 👀

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

맞습니다 ! 👍 정확히 표현하자면 WorldeGameConfig는 클라이언트 단에 즉각적으로 변화가 생길 수 있는 게임 규칙의 역할로 설계했어요.

  • 단어 파일(정답) 교체
  • 라운드(기회) 수 조정 등

이 상수도 고민이 많았지만, 오늘 날짜와 차이를 비교해서 정답을 도출해내는 도구에 국한된다고 생각해서 AnswerProvider에 있는게 맞다고 생각했습니다 !

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오호 저는 이런 부분들이 모두 게임의 규칙이라고만 생각했었는데,, 구체적으로 답변 주셔서 감사합니다 😄

src/main/java/kr/co/wordle/WordleGame.java Show resolved Hide resolved
src/main/java/kr/co/wordle/WordleGame.java Outdated Show resolved Hide resolved
src/main/java/kr/co/wordle/domain/Round.java Show resolved Hide resolved
src/main/java/kr/co/wordle/domain/Round.java Outdated Show resolved Hide resolved
Comment on lines 29 to 30
round = new Round(input);
roundResults.append(round.roundResult(answer)).append("\n");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

input, answer 둘 다 Round 생성 시점에 넣어주도록 할 수도 있고, 둘 다 메서드 호출 시 넘겨주도록 구현할 수도 있을 것 같아요.
Round 객체 생성 시 input만 넣어주고, 메서드 호출 시 answer를 넘겨주도록 설계하신 이유가 궁금합니다!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round가 answer를 갖는 형태가 어색하다고 생각했어요.
반대로 Round 하나 당 사용자 입력을 한 번 받으니까 input은 라운드에 속해있다는 관점으로 설계했습니다.
이렇게 정리하면서 보니까 어색한 느낌이 들기도 하네요 !
리팩토링 포인트로 붙잡아두겠습니다 ... 🤔

char[] inputChars = input.toCharArray();
int[] countPerCharacter = Arrays.copyOf(answer.getCountPerCharacter(), 26);
for (int i = 0; i< WORD_LENGTH; i++) {
Tile key = getTile(countPerCharacter, answer.charAt(i), inputChars[i]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

딱구님과 제가 이쪽 로직에서 countPerCharacter가 Answer의 멤버로 포함되어 있고, 단순히 getter만 제공하고 있는 구조라서 counterPerCharacter가 Answer 내부에 있는게 옳은 방향인가 고민하다가 클래스를 분리했었는데요.
이 부분을 어떤 논의 과정으로 설계, 구현하셨는지 궁급합니다!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분은 깊게 고민하지 않았는데, 말씀을 들어보니 Answer 내부에 countPerCharacter가 있는 게 아주 매끄럽지는 못하군요 🤔
저도 어떻게 풀어나가야 할 지 고민해봤는데 명쾌한 답을 아직 못 찾았습니다 ..
싸무엘님과 딱구님은 어떤 과정으로 클래스를 분리하셨을까요 ~?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저희도 동일한 부분에서 어색하다고 느껴서 분리의 목적으로 countPerCharacter 에 관련된 책임을 갖는 Counter라는 클래스를 만들었어요.
단어의 문자를 비교할 때 count 관련한 기능은 해당 클래스가 담당하도록 했고, 비즈니스 로직에서 Answer와 Counter를 조합해서 문제를 풀어나가면 되지 않을까 생각했던 것 같아요.
100% 명쾌하게 해결한 것인지는 모르겠어서 저도 고민이 더 필요한 부분이긴 해요 ㅎㅎ 다른 분들의 문제 해결 과정도 궁금해지네요!

src/main/java/kr/co/wordle/support/WordFileReader.java Outdated Show resolved Hide resolved
@ycheese ycheese requested a review from samkimuel June 28, 2024 14:22
Copy link

@samkimuel samkimuel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제 의견도 생각해서 반영해주시고, 궁금한 점이 많았는데 모두 친절하게 구체적으로 답변해주셔서 감사합니다! 치즈님의 생각을 알아가며 많이 배울 수 있었어요 🥰
제 부족한 리뷰를 받아주셔서 감사합니다. 앞으로도 파이팅 하시죠! 🚀

Comment on lines +33 to +35
public Round next(String input) {
return new Round(value + 1, input);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

불변 객체 좋네요👍🏻

char[] inputChars = input.toCharArray();
int[] countPerCharacter = Arrays.copyOf(answer.getCountPerCharacter(), 26);
for (int i = 0; i< WORD_LENGTH; i++) {
Tile key = getTile(countPerCharacter, answer.charAt(i), inputChars[i]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저희도 동일한 부분에서 어색하다고 느껴서 분리의 목적으로 countPerCharacter 에 관련된 책임을 갖는 Counter라는 클래스를 만들었어요.
단어의 문자를 비교할 때 count 관련한 기능은 해당 클래스가 담당하도록 했고, 비즈니스 로직에서 Answer와 Counter를 조합해서 문제를 풀어나가면 되지 않을까 생각했던 것 같아요.
100% 명쾌하게 해결한 것인지는 모르겠어서 저도 고민이 더 필요한 부분이긴 해요 ㅎㅎ 다른 분들의 문제 해결 과정도 궁금해지네요!


public class AnswerProvider {

private static final LocalDate REFERENCE_DATE = LocalDate.of(2021, 6, 19);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오호 저는 이런 부분들이 모두 게임의 규칙이라고만 생각했었는데,, 구체적으로 답변 주셔서 감사합니다 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants