[ESS] tip for navigating camelCase
Vitalie S.
spinuvit.list at gmail.com
Sun Nov 7 22:42:32 CET 2010
Stephen Eglen <S.J.Eglen at damtp.cam.ac.uk> writes:
>> For what it's worth, I've gone with Google's style guide
>> for the most part.
>>
>> Hope that explains my rationale for including the
>> mixed case (aka camel case) discussion as it applies
>> to R using ESS!
>
> Thanks for this Erik. I would love to see some standardization in this
> respect, but fear that too many people have too many differing styles.
> e.g. I have previously used . (and hardly ever touch underscore) a lot
> in R. Looking at code in R (e.g. just browse the release notes for
> 2.12.0) and you will see several styles used for function names
> (although I don't see much use of underscore).
>
> Anyone from r-core care to comment -- is there a policy for new code?
> (I appreciate that a lot of old function names are inherited from S).
S4 can be considered a "new code" and given that R is becoming more and more
S4-rish that is probably the way to go.
As far as I can see S4 is written in camelCase almost exclusively:
- functions start with small letters and try to give as complete description by
means of an action verb (i.e. setRefClass, getMethod)
- non exported functions start with "."
- variables are also camelCased but tend to be shorter and start with
a noun (i.e. elNames, envRefClass)
Personally,-I-love-lisp-style.
>
> Stephen
>
> ______________________________________________
> ESS-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
More information about the ESS-help
mailing list