On May 1, 2007, at 7:50 AM, Brendan Murphy wrote:

> This whole discussion misses the point. Maintenance of the code
> "trumps" all the merits of putting DIM statements in any
> other place but the top of the method since putting DIM statements
> within the code are negligible at best. If you scatter your DIM
> statements within your code you make your code harder to read.
> Which is more important, your time as a developer or some
> negligible benefit? If your time is only worth $1 an hour, then
> have at it an write unmaintainable code, but the professional
> developers typically earns $50 or more an hour and making your
> code harder to read is rather short sighted.

That is absolutely and patently incorrect for proper maintenance of  
code -- putting the declarations of variables as close as possible to  
their use is one of the basic tenets of good software design.  If you  
can scope the variables inside of a block so that they aren't  
available outside of the scope of the block is even better.

Here's the kicker:  If you have your declarations of variables in the  
immediate vicinity of their use, you have now made it possible to  
easily refactor that code simply by moving that entire block to a new  
location.  However, if the declaration is at the top of the routine  
"with all of the others", then you have to go through multiple steps  
to refactor the code (move the code then move the declaration).   
Heaven help you if you happen to "reuse" one of those variables  
within the same routine -- that is arguably the biggest cause of  
"unintended features" (e.g. "bugs") in code.

-- 
Glenn L. Austin <><
Computer Wizard and Race Car Driver
<[EMAIL PROTECTED]>
<http://www.austin-home.com/glenn/>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to