-
Notifications
You must be signed in to change notification settings - Fork 0
関数型プログラミングの「文から式」のシフト解説を第4章に追加 #90
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
Conversation
…amming section Co-authored-by: Fujiwo <3992360+Fujiwo@users.noreply.github.com>
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.
Pull Request Overview
This PR adds a comprehensive section about the paradigm shift from statements to expressions in functional programming to Chapter 4 "Multiparadigm Programming". The addition provides readers with practical understanding of expression-oriented programming concepts in modern C#.
Key Changes:
- Added a new subsection "文から式へのシフト:C#における関数型パラダイムの進化" within section 4.4.1
- Included timeline of C# evolution from version 3.0 to 11.0 showcasing expression-oriented features
- Provided three detailed before-and-after code examples demonstrating statement-to-expression transformations
| | **C# 10.0** | global using | グローバルな式の簡潔化 | | ||
| | **C# 11.0** | 生の文字列リテラル | `"""多行文字列"""` | |
Copilot
AI
Aug 30, 2025
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.
The C# 10.0 and C# 11.0 entries are not accurate representations of expression-oriented features. 'global using' is about namespace management, not expression simplification, and raw string literals are about string syntax, not expression-oriented programming. Consider replacing these with more relevant expression-oriented features like 'with expressions for records' (C# 9.0) or 'extended property patterns' (C# 10.0).
| | **C# 10.0** | global using | グローバルな式の簡潔化 | | |
| | **C# 11.0** | 生の文字列リテラル | `"""多行文字列"""` | | |
| | **C# 10.0** | 拡張プロパティパターン | `order is { Customer.Address.City: "Tokyo" }` | | |
| | **C# 11.0** | リストパターン | `nums is [1, 2, .., 10]` | |
| .Where(error => error != null) | ||
| .Cast<string>(); |
Copilot
AI
Aug 30, 2025
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.
Using .Cast<string>() after filtering for non-null values is unnecessary and potentially dangerous. Since ValidateName, ValidateEmail, and ValidateAge return string?, the .Where(error => error != null) already filters out null values. The .Cast<string>() should be replaced with .Select(error => error!) or use OfType<string>() instead of Where().Cast().
| .Where(error => error != null) | |
| .Cast<string>(); | |
| .Select(error => error!); |
第4章「マルチパラダイムプログラミング」の関数型プログラミング節に、文(Statement)から式(Expression)へのパラダイムシフトに関する包括的な解説を追加しました。
追加内容
新規セクション: 文から式へのシフト:C#における関数型パラダイムの進化
主要コンテンツ
コード例の特徴
各実装例では「従来の文指向アプローチ」と「現代的な式指向アプローチ」を並列比較し、以下のモダンC#機能を活用:
技術的改善
この追加により、読者は関数型プログラミングの重要な概念である「式指向思考」を実践的に習得でき、現代的なC#プログラミングスキルの向上に直結します。
Fixes #87.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.