Re: [stella] A warning to newbies -- every cycle becomes sacred!

Subject: Re: [stella] A warning to newbies -- every cycle becomes sacred!
From: Erik Mooney <erik@xxxxxxxxxx>
Date: Tue, 06 May 2003 16:20:08 -0400
On Tue, 06 May 2003 10:00:59 -0400, you wrote:

>Just today I found myself commenting somebody else's code and seeing
>this line of VB6 over and over in a particular function:
>
>If Err.Number <> 0 Then Err.Clear

Well.. there are potential reasons to do that, IMO, as an experienced VB
programmer myself.  First, it's conceivable that the act of Err.Clear (if
Err is a complicated object which it could be) takes more time than
testing Err.Number against 0.  Second, it provides a bit of extra
structure to the program - you're saying flat out that "we're
acknowledging that an error may have happened; if so, clear it" rather
than "clear all errors."  Third, all VB programmers know about the Four
Constants of the Apocalypse: Nothing, Null, Empty, and Error, and you
really can't blame anyone for trying to write more careful code around any
such situation.

Not that it's necessarily the right thing to do in your particular
application, but I'd chalk it up to a matter of style rather than a
clear-cut right or wrong situation.

----------------------------------------------------------------------------------------------
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/


Current Thread