Peter M. Brigham wrote:

> On 3/7/15 1:35 AM, Richard Gaskin wrote:
>> FWIW I appreciate efforts to distinguish getters from setters
>> by including "get" as part of a function name, but it becomes
>> odd to read things like:
>>
>> get getPowerSource()
>>
>> Personally I believe that being a function makes its role as
>> a getter implicitly clear enough as-is.
>
> Good point. I guess this never occurred to me because I never do
> "get …", I always do "put … into varName". The "it" variable is
> somewhat ephemeral if you're not careful. Even with an "ask …"
> I always follow it with a "put it into varName" before proceeding,
> so I don't overwrite "it" later inadvertently.

I use "it" sparingly myself for that reason, but -- perhaps based more on my own ignorant superstitions than anything actually happening in the engine (Fraser, care to chime in?) -- my hunch is that since "it" is already initialized using it saves an additional malloc.

Over the scope of an entire code base this habit might save me as much as two milliseconds. :)

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 ____________________________________________________________________
 ambassa...@fourthworld.com                http://www.FourthWorld.com

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

Reply via email to