I am just wondering what the general consensus is for a situation like this:
You know that the try catch will catch the error when trying to load the file if it doesn't exist and set the "CodeSuccess" variable to false anyways, but would YOU still put in the File.Exists statement anyways?
VB.NET:
Dim CodeSuccess As Boolean = True
Try
If (System.IO.File.Exists("Path_To_File")) Then
'Do something with the file that file.
Else
CodeSuccess = False
End If
Catch
CodeSuccess= False
End Try
You know that the try catch will catch the error when trying to load the file if it doesn't exist and set the "CodeSuccess" variable to false anyways, but would YOU still put in the File.Exists statement anyways?