rbwhitaker / CSharpPlayersGuideEarlyAccess

A place to track issues with the C# Player's Guide for patches and future editions
19 stars 0 forks source link

Consider moving the discussion about `const` to a somewhat revised section on immutability. #666

Closed rbwhitaker closed 1 year ago

rbwhitaker commented 2 years ago

I'd like to reduce the size of the Catch-All chapter toward the end of the book. One way to do that is to move some of the content to other places where they are relevant and where the reader is prepared for it. const is one that could be moved to the discussion about immutability in Level 20, to round out the full discussion. I still want to generally discourage const in favor of readonly, as I already do, but this seems a reasonable place to move it to.

rbwhitaker commented 1 year ago

This has been moved up to the discussion on immutability when talking about properties and readonly. I intentionally wanted to de-emphasize consts vs. the other options, and did so, but I don't think it hurts to put all of this together. And I think it is a good idea to pull stuff out of that final catch-all chapter at the end. I'd honestly prefer to do away with it some day.