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

Chapter04 composite #107

Open
DickBaker opened this issue Nov 14, 2022 · 1 comment
Open

Chapter04 composite #107

DickBaker opened this issue Nov 14, 2022 · 1 comment

Comments

@DickBaker
Copy link

  1. the vs4win\Chapter04.sln omits 5 projects
  • CallStackExceptionHandling
  • CallStackExceptionHandlingLib
  • PrimeFactorsApp
  • PrimeFactorsLib
  • PrimeFactorsTests
  1. in PrimeFactors project Primes.cs the analysers suggest adding readonly and simplification, e.g.
  • public static readonly int[] PrimeNumbers = new[]
  • number /= divisor;
  1. in WritingFunctions Program.cs several statements are commented-out, whereas devs will want to experience these
  2. in WritingFunctions Program.cs the CalculateTax & FibImperative can be much simplified by using modern switch syntax
  3. the .gitignore file is negligible, so any edits for PR include *.obj etc
  4. no .editorconfig (with root=true) to ensure any PRs conform to author's style for consistency
  5. various trailing blanks, inconsistent mix of file/block namespace, unconsolidated Microsoft.NET.Test.Sdk versions, namespace non-match folder hierarchy, some/not top-level [yes I get dotnet7.md advice, but suggest .NET-6 consistency]
  6. GH repo lacks Chapter13-Chapter19 artefacts [yes I get that 18-20 are Bonus Content]

I am submitting a PR with my contrib to the above (use diff to clarify).
BTW Chapter04 caught my eye with MJP's recent commit but other Chapters probably similarly afflicted.

@markjprice
Copy link
Owner

Hi Dick,

1a. The PrimeFactors.sln file references the three exercise files: https://github.com/markjprice/cs10dotnet6/blob/main/vs4win/Chapter04/PrimeFactors.sln

1b. I will update the Chapter04.sln to add the other two projects. Thank you.

  1. readonly keyword is introduced in Chapter 5. The reader is introduced to language features like this slowly to build up their knowledge. Early chapters deliberately use simpler concepts to avoid overwhelming them.

  2. Developers can uncomment out those statements when they are ready to see what they do. But until then they should stay commented to match the "working through the book" experience.

  3. An implementation of FibImperative that uses switch expressions is shown in FibFunctional. The point of step-by-step tasks in an educational book is to build up from traditional style of coding to more modern style of coding so the reader can see the diffences and benefits.

  4. and 6. and 7. This repository is used to share the code samples for the book. Almost all readers just download the ZIP and do not use Git. Unlike most repos on GitHub that are for real projects and only include the current best practice code and configuration, this one is not a repo that readers usually PR, although they are free to do so. I make choices that work best for a learning experience, not what would be used in a real world project.

  5. Chapters 13 to 19 are in the PracticalApps folder: https://github.com/markjprice/cs10dotnet6/tree/main/vs4win/PracticalApps

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

No branches or pull requests

2 participants