Food Fight

Dave Cragg dcragg at lacscentre.co.uk
Tue Jun 21 04:58:46 EDT 2005


On 20 Jun 2005, at 21:06, Dennis Brown wrote:

> Dar,
>
> Thank you for standing up for the rights (in a good natured way) of  
> those who think it's overkill to have all these structured names in  
> a conversational language with handlers that are usually only a few  
> lines long.  Why mar the elegance of a understandable name with  
> cryptic unpronounceable prefix letters all over the place?  It's  
> not as if I wouldn't be able to instantly recognize ten years later  
> what the local variable named partNumber in my 20 line script was  
> for, or even that it was a local.

I sympathise with your view. Although I use east-central-Hungarian- 
semi-strict myself, I'd hate to see this stuff forced on anyone.

But there are advantages that it's useful to know about. Others have  
mentioned namespace clashes. Another advanatge relates to your "ten  
years later" comment. xTalks have a large number of reserved words in  
the form of commands, functions and properties, and over time this  
number has grown. So a variable with a friendly name you create now,  
may become a reserved word ten years from now. Those who spend any  
time converting old Hypercard stacks probably know how frustrating  
this can be. As an example, I recently converted some Hypercard  
stacks that used the names "startframe" and "endframe" as parameters  
in various message and function handlers. I'm sure these seemed  
appropriate to the original author, but the Rev compiler didn't like  
them. Rather than spend time thinking of alternative available  
"natural" names, I just stuck a "p" in front -- pStartframe,  
pEndframe. This quickly becomes a habit, so that  in no tTime, you  
gFind yourself taking sThis approach to pAll variables.

Cheers
Dave


More information about the use-livecode mailing list