Created Nimrod Enhancement Proposal #1 - Standard Library Style and Convention Guidelines (markdown)

This commit is contained in:
Varriount 2014-04-28 12:29:18 -07:00
parent fc45c5c059
commit 47a2760f75
1 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,34 @@
Nimrod Enhancement Proposal #1 - Standard Library Style Guide
Abstract
========
Although Nimrod, through its flexible AST and case-sensitivity settings,
supports a variety of code and formatting styles, it is nevertheless beneficial
that certain community efforts, such as the standard library, should follow
a consistant set of style guidelines when suitable. This enhancement
proposal aims to list a series of guidelines that the standard library should
follow. Note that these are *guidelines* only. The nature of Nimrod being
as flexible as it is, there will be parts of this style guide that don't make
sense in certain contexts. Furthermore, just as
(Python's style guide)[http://legacy.python.org/dev/peps/pep-0008/] changes
over time, this style guide will too.
Style Guidelines
================
General
-------
- All identifiers, except for types, should be in pascalCase. Type identifiers
Should be in CamelCase.
- Members of enums should have an identifying prefix before their
names. For example, the PathComponent enum in the os module contains the
pcFile member, which, like the other members, has the 'pc'
(standing for PathComponent) prefix before its name.
- Lines should be no longer than 80 characters
- 2 spaces should be used for indentation.
- The 'result' variable should be used whenever possible. 'return' should only
be used when it's flow control effects are needed.