Thursday, March 17, 2005

Just found this code in an app:


Try
   If Not Ok Then
      Throw New Exception
   End If
   flag = True
Catch ex As Exception
   flag = False
End Try

PLEASE Don't do this!
The variable names have been changed to protect the innocence, but this is the exact code :( This is an extreme example of how exceptions can be misused.

0 Comments:

Post a Comment

<< Home