Power Status (was Re: Because LC can't do two things at once.)

Peter M. Brigham pmbrig at gmail.com
Sat Mar 7 11:33:48 EST 2015


On Mar 7, 2015, at 11:12 AM, Richard Gaskin wrote:

> Michael Doub wrote:
> 
> > On 3/7/15 1:35 AM, Richard Gaskin wrote:
> >>
> >> What value is being added to the library user with "__"?
> >>
> > I originally did this because I thought it would avoid name space
> > collisions.   I thought that I would receive feedback if folks
> > thought it was a bad idea.   As you can see, it is extra work and
> > it is easy for me to make a mistake.
> >
> > I would be happy to remove them if folks would find it more useful.
> > Please just let me know.
> 
> Such mistakes are easy for all of us, so I'd vote for simplicity.
> 
> Many name-space issues go away with v8, but for now if we feel there's a risk of folks using an existing function named PowerSource we might consider prefacing it with the initials of the collection ("ml" - it's Master Library, yes?), so it could be:
> 
> get mlPowerSource()
> 
> 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.

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig





More information about the Use-livecode mailing list