On 12/15/05, Maninder, Singh <[EMAIL PROTECTED]> wrote:
> I won't touch it :) but I can call the method - right?
>
> Or is it used for some internal calculations?

You certainly can call it, but you probably shouldn't.

The '_' is used in many languages to imply privacy where privacy can't
be enforced.  It's a way for the creator of the app to tell users of
it "don't call this function directly".  It's usually done for some
mix of the following reasons:

The creator is thinking of renaming, removing, or drastically changing
this function in a future version.

Calling this function directly, instead of using the public api, can
cause unexpected side effects and/or errors that may be incredibly
tough to trace.

HTH.

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of
> Abdur-Rahman Advany
> Sent: Thursday, December 15, 2005 5:13 PM
> To: rails-spinoffs@lists.rubyonrails.org
> Subject: Re: [Rails-spinoffs] Generic Question about the way code is
> written
>
>
> Javascript does not have private functions, _ means its a private
> function, don't tuch it ;)
>
> Maninder, Singh wrote:
>
> >Hi,
> >
> >This is a generic question about the way code is written in prototype and 
> >scriptaculous libraries.
> >
> >Inside every object, we find functions that begin with "_".
> >
> >How are these methods/functions different from the rest?
> >
> >eg _text, _attributes, _each...
> >
> >Please let me know.
> >
> >Thank you,
> >Mandy.
> >_______________________________________________
> >Rails-spinoffs mailing list
> >Rails-spinoffs@lists.rubyonrails.org
> >http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
> >
> >
> >
>
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>


--
Bill Guindon (aka aGorilla)
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to