Pretty new to C #, and I would like to know how to use exceptions? I do not mean the level of mechanics, but the level of good practice.
I will use, for example, my calculator, which tokens and converts to RPN and solves the problems specified in RPN.
During the tokenization step, there are various invalid inputs, for example "7.7.8" or "^ & ##", should I have separate exceptions for unknown characters and invalid numbers? Is it wrong to say that there is one exception and then a method containing the type of error that should be provided to the user?
I really could not find a lot of material about this, so I thought that I would ask people with more experience than me.
----- Edit:
Thank you all for your wonderful answers, I found out ton today :) about my question and even about what really is.
source
share