So, what is better to use?
bool parsed = int.TryParse(string, out num);
if (parsed)
…
OR
try {
int.Parse(string);
catch(){
do something…
}
Well, better is subjective!
If you don’t care to know why your int.TryParse fail, then use it.
However, int.Parse can (according to the documentation) throw three different exceptions:
the input is null
the input is not in a valid format
the input contains a number that procudes an overflow
If you care about why it fails, then int.Parse is clearly the better choice.