Re: Bit flipping .. will this work in VB6?
- From: "Michael C" <mike@xxxxxxxxxx>
- Date: Tue, 11 Mar 2008 10:34:59 +1100
"Steve Gerrard" <mynamehere@xxxxxxxxxxx> wrote in message
news:0dSdnS64ysvTmkzanZ2dnUVZ_uuqnZ2d@xxxxxxxxxxxxxx
I think there are some significantly different categories of errors in
discussion here. Some errors are not your fault - perhaps the system has
failed in some way, or the user has done something foolish. Those kinds of
errors should go back up the stack to the appropriate level for catching
them, informing the user that something didn't work, and cleaning up as
much as possible.
The other kind, such as you or another programmer on the project writing
TwoToThe(100), are errors in programming that you are trying to catch. I
have found that using Debug.Print or Debug.Assert is very useful for
these. It is not the case for all programs, but in my case a user
reporting some odd behavior can send me the file they are working on, and
I can run the program from the IDE with their file. Often I will start
getting assertions or debug output that indicates what is going on (or not
going on).
I had a user call me the other day with an error that they didn't have space
in the database even though they had 190gig free on the hdd. Turns out
they'd reached their 2GB limit of MSDE. So for me getting a copy of the
database is quite often not possible.
The advantage of this is that the user is not bogged down by meaningless
(to them) error messages, especially when then they are just going to
click okay and continue working anyway. That's when a function just
returning 0 makes sense to me. I can still tell it happened because it
will report in the IDE as a Debug.Print or Debug.Assert; the user does not
need to be troubled by it. It is also possible to simply log these, and
check the log records.
While that is true the disadvantage is that the user can get invalid data
saved in the database. If the function was designed to calculate the amount
of tax that should be deducted from someone's wage and the function returns
zero then you've got problems. Those problems might not become evident until
the end of financial year (assuming this affects only a few employees who
keep their mouths shut). By that time you could have real problems and
depending on the data, you might have no way to tell what it should be. The
idea behind the error handling in VB6 is that if you get a bug in your
program then something it wrong and it is considered that the program is in
an unknown state and anything could happen. Because of this execution should
be stopped immediately, an error reported and support call logged. I guess
it depends on how critical your app is. The behaviour you get after an error
is essentially random and you're taking a chance as to what that will do. If
you're writing a sudoku program then the worst that can happen is someone
loses their game. If you're writing a financial app though....
Michael
.
- Follow-Ups:
- Re: Bit flipping .. will this work in VB6?
- From: Steve Gerrard
- Re: Bit flipping .. will this work in VB6?
- References:
- Bit flipping .. will this work in VB6?
- From: Ronald Raygun
- Re: Bit flipping .. will this work in VB6?
- From: Michael C
- Re: Bit flipping .. will this work in VB6?
- From: Larry Serflaten
- Re: Bit flipping .. will this work in VB6?
- From: Karl E. Peterson
- Re: Bit flipping .. will this work in VB6?
- From: Michael C
- Re: Bit flipping .. will this work in VB6?
- From: Karl E. Peterson
- Re: Bit flipping .. will this work in VB6?
- From: Michael C
- Re: Bit flipping .. will this work in VB6?
- From: Karl E. Peterson
- Re: Bit flipping .. will this work in VB6?
- From: Michael C
- Re: Bit flipping .. will this work in VB6?
- From: Karl E. Peterson
- Re: Bit flipping .. will this work in VB6?
- From: Michael C
- Re: Bit flipping .. will this work in VB6?
- From: Karl E. Peterson
- Re: Bit flipping .. will this work in VB6?
- From: Michael C
- Re: Bit flipping .. will this work in VB6?
- From: Karl E. Peterson
- Re: Bit flipping .. will this work in VB6?
- From: Michael C
- Re: Bit flipping .. will this work in VB6?
- From: Karl E. Peterson
- Re: Bit flipping .. will this work in VB6?
- From: Michael C
- Re: Bit flipping .. will this work in VB6?
- From: Karl E. Peterson
- Re: Bit flipping .. will this work in VB6?
- From: Michael C
- Re: Bit flipping .. will this work in VB6?
- From: Karl E. Peterson
- Re: Bit flipping .. will this work in VB6?
- From: Michael C
- Re: Bit flipping .. will this work in VB6?
- From: Steve Gerrard
- Re: Bit flipping .. will this work in VB6?
- From: Michael C
- Re: Bit flipping .. will this work in VB6?
- From: Steve Gerrard
- Bit flipping .. will this work in VB6?
- Prev by Date: Re: microsoft.public.vb
- Next by Date: Re: It's That Time Of Year Again...
- Previous by thread: Re: Bit flipping .. will this work in VB6?
- Next by thread: Re: Bit flipping .. will this work in VB6?
- Index(es):
Relevant Pages
|