implicitVars [Was: Re: Best Practices in Rev development]

Dave dave at looktowindward.com
Sun Jul 1 06:30:41 EDT 2007


On 29 Jun 2007, at 13:52, Ken Ray wrote:

> On Fri, 29 Jun 2007 11:31:31 +0100, Dave wrote:
>
>> That's why I can't see the argument that's it's more typing, it
>> really isn't, and the bugs that can be caused by not declaring your
>> locals are so hard to find that I really can't see any reason not to
>> declare them.
>
> Well, if you have a handler that is quite long (larger than one full
> screen's worth), you would have to keep scrolling up and down to copy
> and paste variables. If you copy and paste it may not be more  
> *typing*,
> but it's still a PITA which you don't need to do if your variables are
> not declared. Personally, my feeling is "whatever works for you, works
> for you" - by that I mean that over the years of not declaring xTalk
> variables I have gotten to the point that the likelihood of me making
> an error in typing a variable is extremely low, so there really is  
> very
> little benefit and a lot of extra hassle for me to start declaring
> them. But that's me... Anything that makes the process more efficient
> is good, IMHO.

Well, long functions are a different probem, best practice would be  
to split a long functions into a number of smaller ones.

But even if the function is long, you don't have to keep scrolling up  
and down, depending on the editor you are using and the platform you  
are running, it's easy enough to either split the window so the  
locals are in the top pane or copy them to a separate window. I  
usually have CodeWarrior running and have a number of windows that  
contain bits of code I have pasted into place that I can re-use later  
on.

All the Best
Dave





More information about the use-livecode mailing list