Explicit Variables again

Mark Wieder mwieder at ahsoftware.net
Fri Oct 19 11:48:29 EDT 2012


Friday, October 19, 2012, 7:47:22 AM, you wrote:

> I've since added a bunch of shortcuts I use all the time, like listing
> globals vars and props, and stack lists, and the message path, and other
> stuff, and then I started down the road of implementing a few shell 
> calls like "ls" and "cd" - and of course now the challenge is to stop
> doing that so I can just post it for others to use.  I have an update
> for devolution in the works that'll include it once I get a few client
> things out of the way.  It'll be MIT licensed so folks can tear it apart
> and make their own if they want.

! Looking forward to that.

> Some history trivia for those who might care:

Thanks. I do care.

> I write tons of code, and then I have to also write unit tests and 
> harnesses for it - and I need a new feature that requires even more 
> discipline? :)

<sigh> Look, as a qa engineer let me state the truism that the earlier
in the development process you can find bugs, the cheaper it is to fix
them. The idea of enforcing explicit variable declarations is to catch
some bugs at compile time rather then waiting for them to appear at
runtime and force you to debug what happened.

Have you ever typed something like

"if theversion > 4.5 then"
instead of
"if the version > 4.5 then"

Easy enough to find if it's in front of you like that, but what if
it's buried in several hundred lines of code? With explicitVars
enabled the compiler will tell you what line of code failed when you
press the Apply button.

I believe in letting the compiler help me rather than fighting against
it. That's the whole reason I enable explicitVars. I can't count the
number of stupid typos I've caught this way in my code, in other
people's code, and in the IDE. Stuff that should never have gotten out
the door in the first place, and wouldn't if people just let the
compiler exercise some "discipline".

-Mark Wieder
 mwieder at ahsoftware.net

More information about the Use-livecode mailing list