rbwhitaker / CSharpPlayersGuideEarlyAccess

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

The Path of User Input #677

Closed rbwhitaker closed 1 year ago

rbwhitaker commented 1 year ago

One common pitfall readers have is figuring out how to deal with user input. I've seen people who are brand new to programming (or maybe they've tinkered in some other languages) get it in their heads that they need to solve the problem of the user entering any sort of bad input.

Indeed, that is usually a good thing, and I'd normally encourage it.

Unfortunately, I've seen a lot of people make a horrible mess of the code by copy/pasting TryParse methods and exception handling and things like that into their code for a challenge in Level 6 or 7, and have no clue why it isn't working. But they've cobbled it together from web searches.

I don't want to tell people they shouldn't go researching extra things, but I do want people to know that all of that stuff is coming, and the stakes are low enough that they can ignore bad inputs until they learn more.

So there needs to be a thread woven through the early chapters and back into the TryParse and exception handling chapters to explain expectations around user inputs.

rbwhitaker commented 1 year ago

This has been added now.