Explicit Variables again

J. Landman Gay jacque at hyperactivesw.com
Fri Oct 19 14:00:56 EDT 2012


On 10/19/12 11:41 AM, Richard Gaskin wrote:

> If I also take the time to declare every variable (or, as we've seen,
> most variables, since apparently not all require declaration under
> explicitVars), that's just extra stuff to revise while I'm also revising
> code. So I can see how it would be a benefit to some, but for me it just
> slows me down.

That's my style too. And I like short, concise code, and having all that 
extra stuff at the top of each handler just visually annoys me.

Typos are almost never a problem for me. I only type variable names once 
when I first write them. I have a custom frontscript that includes a 
whole lot of handy things, one of which is the ability to insert or 
replace the selection with whatever word I point at. When I need to use 
an existing variable, I just point at the original and hit a keyboard 
shortcut and the variable name goes into the script with no typing. If 
the handler is longer than the script window (very rare for me) then I 
use copy/paste or the replace dialog.

I've been doing this for years and I virtually never have a misspelled 
variable name. I do misspell other things, but the compiler tells me it 
can't find the handler, or that the line as written doesn't make sense.

The result is tight code that reads like a story without any 
interruptions in conceptualization. It seems to me that's the whole 
point of the language -- it eliminates all the extra cruft that other 
languages require. I suppose that's my HyperCard background coming 
through, but then again, HC set the bar.

I'd be interested in the results if someone sets up a poll to see how 
many people use explicit variables. I've always thought it was a 
minority but maybe that's not so.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list