When writing code, how does one decide between using if/else or try/catch? For example, in checking for a file, should this be based on if/else (if (File.Exists)) or a try/c
in general it depends
For file based stuff you almost always want to try the operation and handle failures rather than check first. the reason being that the file system is a shared resource and you cannot guarantee that after file.exists returns true the file does exist as some other process may have deleted it in the mean time.