Newbie... Strict Compilation mode

Bernard Devlin bdrunrev at gmail.com
Sun May 10 05:08:09 EDT 2009


The interesting thing is that both Jim/Mark & Jacques are right.

Like Jacques I rarely have a major problem with mis-spelt variables.
On the occasions when I do have a problem then the error message will
usually point me to where the problem lies, and if not then the fact
that a variable contains its own name as a value shows me that it was
never touched.  But maybe it takes a long time of using Rev to
understand such error situations, so explicit variables might well be
useful to newbies even if long-in-the-tooth users such as myself
usually operate without them.  There are still occasions when I think
to myself "Hmm... maybe it would be better if I used explicit variable
checking".

But when I started out with Rev I tried turning on explicit variables
over several releases, but it was so broken that the IDE stopped
working (it must have had undeclared variables in it).  So after years
of not using explict vars, it seems onerous to now switch it on.

One could argue against Jacques' claims of unnecessary clutter, that
such clutter can be minimized by declaring multiple variables on one
line ("local tVar1, tVar2").  But I think there is a wider issue with
reducing error incidence by restricting the way in which variables
come into being.

Jim's example about custom properties not being checked by explicit
vars highlights this problem - a mis-spelling was staring him in the
face.  Jim thought he didn't have to be concerned with variable
mis-spelling, because he had explicit vars turned on.  Jaqcues and I
would both be on the look out for misspellings :-)  (That's not to
elevate myself to the same level of programming ability shared by
Jacques and Jim.)  Given how much use I make of custom properties and
array keys as ways of structuring my code, there is always going to be
a problem with mis-spellings in such dynamic constructs.

In addition to that, there are other things that the compiler doesn't
check but should:

http://quality.runrev.com/qacenter/show_bug.cgi?id=7791

Strangely enough one of those errors is caught by having explicit
variables turned on.  The others are not.

I can see the benefit in having explicit variable checking and in not
having it.  But I hesitate to call it "Strict Compilation Mode" when
the compiler is so lax about language use that appears as
ungrammatical as in that bug report.

Bernard

On Sun, May 10, 2009 at 9:20 AM, stephen barncard
<stephenREVOLUTION2 at barncard.com> wrote:
> I love it when the Titans of Transcript battle.... we learn so much....
>
> -------------------------
> Stephen Barncard
> San Francisco
> http://barncard.com
>
>
> 2009/5/9 Jim Bufalini <jim at visitrieve.com>
>
>> Mark Wieder wrote:
>>
>> > I recognize hyperbole when I see it, but nonetheless I don't think you
>> > can have 8 lines of declarations and three lines of actual script (and
>>



More information about the use-livecode mailing list