Creation Date: Antiquity.
Last Edit Date: 2 Apr 2013.
Using similar coding style helps people understand code. These
guidelines are really just preferences; they are not enforced. The
IRanges package provides a model for coding style and organization.
- Use 4 spaces for indenting. No tabs.
- No lines longer than 80 characters.
- Use camelCaps: initial lowercase, then alternate case between words.
- Use camelCaps: initial lower case, then alternate case between words.
- Do not use '.' (in the S3 class system,
x is class
A will dispatch to
- Use CamelCaps: initial upper case, then alternate case between
Use of space
- Always use space after a comma. This:
a, b, c.
- No space around "=" when using named arguments to functions. This:
- Space around all binary operators:
a == b.
- Use "##" to start full-line comments.
- Indent at the same level as surrounding code.
- Import all symbols used from packages other than "base". Except for
default packages (base, graphics, stats, etc.), fully enumerate
- Export all symbols useful to end users. Fully enumerate exports.
= for assignment.