Do you think this is a bad idea or not( C++)
-
Exactly. I was expecting this answer. Many programmer get excited that their program continues to run inspite of an exception like access violation and forget that there might be something dangerous that occured like memory overwrite etc. so the program may not be in a valid state to continue. I had tough time convincing one of the programmer to drop that habit.
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan
I've had similar experiences. I've also had to debug code which had bugs caused by such code and in the worst case the problem took weeks to track down.
Steve
-
Exactly. I was expecting this answer. Many programmer get excited that their program continues to run inspite of an exception like access violation and forget that there might be something dangerous that occured like memory overwrite etc. so the program may not be in a valid state to continue. I had tough time convincing one of the programmer to drop that habit.
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan
In Visual Basic, this error is known as
On Error Resume Next
. I'm trying to get rid of this in a product I'm maintaining.Stability. What an interesting concept. -- Chris Maunder
-
In Visual Basic, this error is known as
On Error Resume Next
. I'm trying to get rid of this in a product I'm maintaining.Stability. What an interesting concept. -- Chris Maunder
Mike Dimmick wrote:
On Error Resume Next
Actually, it is not as bad as the catch all. catch all can have severe problems.
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan
-
Mike Dimmick wrote:
On Error Resume Next
Actually, it is not as bad as the catch all. catch all can have severe problems.
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan
We had On Error Resume Next in a method of a COM class which looked like this:
Public Sub FormatMessage(vtArgs() As Variant)
For i = 0 To UBound(vtArgs)
' Do something
Next
End SubThis was fine when called from a VB6 client, but in VB.NET it was possible to pass
Nothing
as the argument. Trying to doUBound(vtArgs)
caused an error to be raised, but the next statement was the next call toUBound(vtArgs)
. Result: infinite loop. Hmm, maybe I should post that...Stability. What an interesting concept. -- Chris Maunder