Programing style

Eric Chatonet eric.chatonet at sosmartsoftware.com
Sun Nov 19 06:33:31 EST 2006


Hi all,

I am used to put a "u" before custom properties names.
As I put a "t" before local variables, a "g" before globals, etc.
And always use meaningful words:

on SetOtherUsersList pCurUserNo
   local tOtherUsersList
   -----
   put AllUsersList() into tOtherUsersList --
   delete item pCurUserNo of tOtherUsersList
   set the uOtherUsersList of this stack to tOtherUsersList
end SetOtherUsersList

Using prefixes allow to use the "same" names for variables, props,  
functions, etc. that are related while you know exactly what it is.
This seems to me making the code more readable :-)

Le 17 nov. 06 à 17:51, Tereza Snyder a écrit :

> On Nov 17, 2006, at 12:43 AM, Dar Scott wrote:
>
>> The syntax identifies properties, so why give them a special prefix?
>
> I use "u" before my custom property names to distinguish them from  
> built-in properties for several reasons. First, I won't be bollixed  
> when new properties are added to the built-in properties that  
> happen to collide with my well-thought out property name; second,  
> it draws the distinction succinctly in the script between a  
> property that's meaningful for the task and those pertaining only  
> to the GUI; and third, I can help myself avoid runtime errors  
> because typing "put xxx into uYYY" throws a terezaSyntaxError.


Best Regards from Paris,
Eric Chatonet
------------------------------------------------------------------------ 
----------------------
http://www.sosmartsoftware.com/    eric.chatonet at sosmartsoftware.com/





More information about the use-livecode mailing list