Friday, April 13, 2007

Fun with Naming Conventions

Back in the days of Visual Basic 6, they way you did error checking was something like this:

On Error Goto ErrHandler:
N = 1 / 0 ' cause an error
'
' more code
'
Exit Sub
ErrHandler:
' error handling code
Resume Next
End Sub

When I worked on one project, I actually found this code running in production:

On Error Goto Hell:
'
' code was here
'
Exit Sub
Hell:
' error handling code
Resume Next
End Sub

So remember, don't drink and code...

No comments:

       

Blog Archive