incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Aufreiter ...@zive.at>
Subject Re: Data.js — A Graph Manipulation Framework on top of CouchDB
Date Tue, 17 May 2011 12:52:31 GMT
I see this as a matter of convention. Since value properties and functions share the same namespace
on an object you need to think about a proper naming scheme. Within Data.js I use the _ to
denote system specific properties. By doing so the user can extend the object without running
into naming collisions. Like in CouchDB _id, _rev, _deleted, _conflicted, _dirty simply denote
properties that have a special meaning for the system/framework. 


-- Michael
On Tuesday, May 17, 2011 at 2:41 PM, Gabor Ratky 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
> 


Mime
View raw message