On Jan 1, 2011, at 5:36 PM, Peter van der Zee wrote: > On Sun, Jan 2, 2011 at 12:17 AM, jemptymethod <[email protected]> wrote: > On Jan 1, 10:08 am, jmulligan <[email protected]> wrote: > > I do something similar with my lib (http://github.com/avoidwork/ > > abaaso) that's under dev. It works well, but you can't use private and > > public. they're reserved. > > That's why I slap "$" on front of private and public. > > > Instead of $ (dollar) prefix, you could also _ (underscore) prefix private > methods. That way you don't have to artificially grow your (public) method > names with php-like ugliness. I personally use the $ prefix for variables > returned by libraries like jquery or prototype. To easily distinct those from > regular dom (or other) vars. > > I think the underscore is kind of the js-way, but I don't really have > anything to back that up so somebody might correct me on the issue :) > > Whenever I see $ prefixed vars, and they're not clearly used to distinct var > contents, I usually suspect a php user. Especially if they don't use `var` :p > > - peter
i also use _ to hint the developers that the method is intended to be private. i use $ as the result for jQuery like instead to have myElement i use $myElement this way i give the hint that the API is the jQuery API and not the HTMLElement API > > -- > To view archived discussions from the original JSMentors Mailman list: > http://www.mail-archive.com/[email protected]/ > > To search via a non-Google archive, visit here: > http://www.mail-archive.com/[email protected]/ > > To unsubscribe from this group, send email to > [email protected] -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
