couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Copenhaver <sean.copenha...@gmail.com>
Subject Re: Data.js β€” A Graph Manipulation Framework on top of CouchDB
Date Tue, 17 May 2011 12:46:47 GMT
Well if you follow the closure pattern to objects there are privates in
Javascript. Javascript's prototypical inheritance doesn't allow for
private/protected since that's a separate object you are accessing.

Anyway, underscore.js is just a library and they called it that because
that's the root variable they chose I believe. For most OOP code you'll see
the use of underscore to prefix private variables like Gabor said.

On Tue, May 17, 2011 at 8:41 AM, Gabor Ratky <rgabo@rgabostyle.com> wrote:

> Usually it denotes the private API of the object, functions that you're not
> supposed to call from the outside. As there are no private / protected /
> public functions in JavaScript, this naming convention is used.
>
> Hope that helps,
> Gabor
> On Tuesday, May 17, 2011 at 2:39 PM, Peter Nolan wrote:
> Don't mean to highjack the email chain, but somethings been bugging me for
> > quite some time and was hoping one of you guys could help me.
> >
> > In general, what does the underscore symbol generally mean in OOP? For
> > example, when viewing other peoples code i see a bunch of
> {}._someProperty -
> > why do they add the underscore?
> >
> > Generally when i code i add the underscore symbol as a simple means of
> > keeping the 'important' stuff first in the directory listing on my
> computer.
> >  But what does it generally mean to the community?
> >
> > (underscore.js is what prompted this question btw)
> >
> >
> > Great work again man,
> >
> > -Pete
> >
>



-- 
β€œThe limits of language are the limits of one's world. β€œ -Ludwig von
Wittgenstein

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message