-
Notifications
You must be signed in to change notification settings - Fork 5
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주차 - 권태형 #488
base: main
Are you sure you want to change the base?
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.
Hello @TaeHyoungKwon, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
This pull request summarizes Chapter 5 of a book, focusing on the concepts of overloading, overriding, typeclasses, and kinds. The author reflects on their understanding of these concepts before and after reading the chapter, and discusses the practical application of overloading versus using union types. The author also shares their thoughts on the book's explanations and structure.
Highlights
- Overloading vs. Union Types: The author discusses the criteria for choosing between overloading and union types, noting that overloading is generally preferred except when dealing with heterogeneous lists like
List("a", 2, "c")
. - Method Overriding: The author reflects on the use of method overriding in Java and questions the practicality of the book's examples, suggesting that simpler solutions might exist in real-world scenarios.
- Understanding Type Concepts: The author highlights how the book helped them understand the logical underpinnings of type checking and runtime type determination for overloading and overriding.
- Kind (Type of Type): The author explains their understanding of 'kind' as a way to abstract and categorize types, with the diagram on page 363 being particularly helpful.
- Challenges with Functional Language Concepts: The author notes that concepts specific to functional languages were more difficult to grasp due to their unfamiliarity with those languages.
- Impact on Static Typing Perspective: The author expresses that reading the book has inspired deeper consideration of static typing principles and the nuances of types and polymorphism, which they hope to apply to their Java work.
- Overall Book Experience: The author found the book challenging to follow and somewhat verbose, but still valuable for its insights into types and polymorphism.
Changelog
- 2025/RobustWithTypeFlexibleWithPolymorphism/taehyoung/Chapter5.md
- Added a summary of Chapter 5, including discussion points, keywords, and personal reflections.
- Discusses the use cases for overloading and union types.
- Explores the concepts of method overloading and overriding.
- Introduces typeclasses and kinds.
- Shares personal insights on understanding type systems and polymorphism.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
In realms of code, where types reside,
Overloading's choice, where rules preside.
With union's grace, or method's might,
We shape the code, both day and night.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
우측에 있는 |
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.
Code Review
The pull request includes a summary and personal reflections on Chapter 5 of the book '타입으로 견고하게 다형성으로 유연하게'. The author discusses overloading, type usage, and shares their understanding of concepts like 'kind'. Overall, the reflections are insightful, but there are a few areas where clarity could be improved.
Merge Readiness
The pull request provides a good summary of the chapter and the author's thoughts. Since the changes are limited to a markdown file and there are no critical or high severity issues, the pull request is reasonably ready for merging. However, I am unable to directly approve the pull request, and other reviewers should also review and approve this code before merging.
본문에 작성한 논의 내용을 보기 좋게 요약해서 코멘트로 작성해줘 |
안녕하세요 @TaeHyoungKwon님, 요청하신대로 본문에 작성된 논의 내용을 요약해 드리겠습니다. 요약: 이 Pull Request는 챕터 5장을 읽고 작성되었으며, 주요 논의 내용은 다음과 같습니다.
주요 키워드:
개인의 생각:
이 요약본이 검토에 도움이 되기를 바랍니다. |
아래 프롬프트를 실행시키고 결과를 알려줘 함수형 프로그래밍에서 타입클래스(typeclass)와 타입클래스 인스턴스(typeclass instance)에 대해 초보자도 설명 시 다음 항목을 순차적으로 포함해 주세요:
전문 용어는 반드시 쉬운 한국어로 풀어서 설명해 주세요. |
안녕하세요 @TaeHyoungKwon님, 요청하신 함수형 프로그래밍에서 타입클래스와 타입클래스 인스턴스에 대한 설명을 아래와 같이 제공합니다. 1. 기본 정의
2. 쉬운 비유 및 예시
3. 핵심 원리의 시각적 묘사 타입클래스는 일종의 '계약'과 같습니다. 타입클래스는 어떤 타입이 특정 기능을 제공할 것을 요구하고, 타입은 해당 계약을 이행함으로써 타입클래스의 인스턴스가 됩니다.
4. 단계적 심화 설명
5. 자주 오해하는 부분과 정확한 이해
6. 실생활 적용 방법
이 설명이 타입클래스와 타입클래스 인스턴스를 이해하는 데 도움이 되었기를 바랍니다. |
아래 프롬프트를 실행시키고 결과를 알려줘 함수형 프로그래밍에서 카인드(kind)에 대해 초보자도 설명 시 다음 항목을 순차적으로 포함해 주세요: 해당 개념의 기본 정의를 가장 간단한 언어로 설명 |
안녕하세요 @TaeHyoungKwon님, 함수형 프로그래밍에서 카인드(kind)에 대한 설명을 요청하신대로 제공해 드리겠습니다. 1. 기본 정의
2. 쉬운 비유 및 예시
3. 핵심 원리의 시각적 묘사 카인드는 타입 시스템의 '메타 정보'와 같습니다. 타입이 어떤 종류의 값인지(예: 정수, 문자열, 리스트) 알려주는 것처럼, 카인드는 타입이 어떤 종류의 타입인지(예: 일반 타입, 타입 생성자) 알려줍니다.
4. 단계적 심화 설명
5. 자주 오해하는 부분과 정확한 이해
6. 실생활 적용 방법
이 설명이 카인드를 이해하는 데 도움이 되었기를 바랍니다. |
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.
gemini가 대신 정리도 잘 해주고 설명도 잘 해주니 좋네요.
👍
@@ -0,0 +1,44 @@ | |||
# 논의 내용 | |||
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.
저도 생각해 보면 꼭 이거나 타입에 맞게 썼다기 보다는 코드를 작성하다 보니 오버로딩이 필요하지 않을까? 제네릭으로 만들면 좋지 않을까? 로 발전했던 것 같습니다.
엄밀히 따지면 제가 주로 사용하는 언어인 C#은 이거나 타입을 지원하지 않으므로 이거나 타입을 생각하고 코드를 짠건 아닌 것 같네요.
|
||
2. 책 330p 메서드 선택의 한계 부분에서, _add 메서드를 구현한 클래스 예제를 내면서, 이 코드가 어째서 올바르게 add를 구현한 것인지 독자 스스로 고민해보라는 내용이 나옵니다. 본인이 생각했던 것에 대해서 얘기해보면 좋을 것 같습니다 | ||
|
||
3. 책의 내용과 별개의 논의 내용인데, 주요 개념들이 나오기 전에 처르지와 큐리 박사가 대화를 나누면서 설명해주는 부분이 있는데요 이부분 설명이 적절하다고 보시나요? 저는 사실 별로 와닿는 설명이라는 느낌이 안들어서 중간부터는 자세히 읽지 않고 넘어갔는데, 다른 분들은 어떻게 느끼셨는지 궁금합니다 |
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.
저는 어려울 수 있는 설명에 대해 일반적인 수준의 이해를 돕기 위해 만든 대화형 맛보기 예제라는 생각이 들긴 했습니다.
그 대화 내용에 보면 볼드체로 되어 있는 단어들이 있는데 그 단어가 책의 소주제를 설명하기에 적합한 용어입니다를 표현한거라 책 내용을 읽고 다시 큐리 박사와 처르지의 대화 내용에 볼드체 단어를 보면 무슨 단어인지 알게 될겁니다.
아마 프로그래밍 언어 이해가 어려운 사람한테는 뭘 이해해야 하는지 큐리 박사와 처르지 대화 내용으로 파악할 수 있지 않나 생각도 드네요.
# 논의 내용 | ||
1. 저자는 오버로딩을 써야할 때 그리고, 이거나 타입을 써야할 때에 대해서 설명해주고 있습니다. 이 책을 읽기 전까지, 제 경우 사실 이 책에서 제시한 기준에 따라 사용하기 보다는, 일단 쉽고 빠르게 구현하기위해서 무의식적으로, 이거나 타입을 쓰고, 오버로딩으로 리팩토링 하는 방식으로 작업했던 것 같습니다 다른 분들의 경우에 이 책에서 제시한 오버로딩을 써야할 때, 이거나 타입을 써야할 때 기준에 맞춰서 코드를 작성해왔는지 말해보면 좋을 것 같습니다 | ||
|
||
2. 책 330p 메서드 선택의 한계 부분에서, _add 메서드를 구현한 클래스 예제를 내면서, 이 코드가 어째서 올바르게 add를 구현한 것인지 독자 스스로 고민해보라는 내용이 나옵니다. 본인이 생각했던 것에 대해서 얘기해보면 좋을 것 같습니다 |
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.
저는 _add() 메서드에서 Vector와 SpaseVector 타입에 맞게 동적 오버로딩 호출이 잘 되겠구나라고 이해하긴 했습니다.
앞선 설명에서 동적 타입에 맞게 add() 함수가 호출되지 않는다고 설명을 했었으니까요.
@@ -0,0 +1,44 @@ | |||
# 논의 내용 | |||
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.
저는 수가 적고 사용자 정의가 직접적으로 들어간다면 오버로딩을 수가 많고 일반화가 필요하면 제네릭을 떠올릴 것 같습니다.
|
||
2. 책 330p 메서드 선택의 한계 부분에서, _add 메서드를 구현한 클래스 예제를 내면서, 이 코드가 어째서 올바르게 add를 구현한 것인지 독자 스스로 고민해보라는 내용이 나옵니다. 본인이 생각했던 것에 대해서 얘기해보면 좋을 것 같습니다 | ||
|
||
3. 책의 내용과 별개의 논의 내용인데, 주요 개념들이 나오기 전에 처르지와 큐리 박사가 대화를 나누면서 설명해주는 부분이 있는데요 이부분 설명이 적절하다고 보시나요? 저는 사실 별로 와닿는 설명이라는 느낌이 안들어서 중간부터는 자세히 읽지 않고 넘어갔는데, 다른 분들은 어떻게 느끼셨는지 궁금합니다 |
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.
저는 대부분 다형성을 일반화하여 생각했을 때 (컴퓨터적 사고?) 나오는 오류들에 대해서 말하는 느낌을 받았습니다. 실제로 책에서 주어지는 예제도 비슷한 흐름으로 오류가 발생하는 사례와 개선하는 흐름으로 보여줘서 좋았습니다!
챕터5장 읽고 작성하였습니다 Close #485