rbwhitaker / CSharpPlayersGuideEarlyAccess

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

Bonus Level 3 knowledge check asks about something not covered in the chapter #632

Closed rbwhitaker closed 2 years ago

rbwhitaker commented 2 years ago

Death Strike Gaming — 03/22/2022 "Bonus Level: C Debugging Your Code" does not cover the release configuration during debugging "True/False. You can attach a debugger to a program built in the Release configuration." this information would only be obtained by testing in both configurations, and would be made with best guess if you only read the bonus levels for debugging info. Death Strike Gaming — 03/22/2022 Though this is hinted at in Build Configuration of Chapter 3 by stating the release configuration will strip out unoptimized code making it harder to use the debugger, making the question less self contained to the Bonus Level Chapter. rbwhitaker — 03/22/2022 You are absolutely right! That's an oversight. Like you said, there's some hints about it in Level 3, and Bonus Level C doesn't specifically say you can't do it. But it really was meant to be explicitly stated.

The only way to really find out would be to just try it out. Which... I don't mind people coming to that conclusion and giving it a try. It's a good way to learn. But I definitely wanted that to be clear, and I need to revise the text there to make it clear.

And just to make it abundantly clear here to anybody who couldn't figure out the answer, the answer is that yes, you can. The catch is that optimized code (and I do hope it is clear from the book that the Release configuration is optimized while Debug is not by default) changes things in sometimes surprising and complex ways, and so you'll get a degraded experience with debugging. For example, some breakpoints could be on lines that get optimized out, and they won't get hit.

Thanks for reporting that! Death Strike Gaming — 03/22/2022 Not a problem just felt as a section review "test" it was strange for it not to mention it, when Chapter 3 suggests trying out the Bonus level before covering that information.

rbwhitaker commented 2 years ago

I have opted to delete this question. It is an interesting question, but I'm not sure how meaningful it is for readers of this book. And trying to figure out how to get this information into the chapter just seems like quite a bit of work for little value.