Explicit Variables again

Ralph DiMola rdimola at evergreeninfo.net
Fri Oct 19 14:26:23 EDT 2012


I have always used explicit variable checking since the first language that
had the option. I make spelling errors now and again this has saved me more
than a few times. I like that repeat loops vars do not have be declared.
This make the top of the code cleaner. I agree that cleaner and leaner the
better but I live with the local statements at the top. By the way, Putting
local statements anywhere but at the top is crazy. VB6 allows this as well
as LC but I never do it.

In short I have used strict compile mode since the first time I fired up LC.
It was one of the first things I looked for when perusing the pref screens
and turned it on.

Ralph DiMola
IT Director
Evergreen Information Services
rdimola at evergreeninfo.net


-----Original Message-----
From: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] On Behalf
Of J. Landman Gay
Sent: Friday, October 19, 2012 2:01 PM
To: How to use LiveCode
Subject: Re: Explicit Variables again

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

_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the Use-livecode mailing list