nep1: use subjectVerb, not verbSuject (#14732)
This commit is contained in:
parent
ac8ab4c549
commit
79c90b30ee
1 changed files with 6 additions and 2 deletions
|
|
@ -101,11 +101,13 @@ changed in the future.
|
||||||
fd: int64
|
fd: int64
|
||||||
HandleRef = ref Handle # Will be used less often
|
HandleRef = ref Handle # Will be used less often
|
||||||
|
|
||||||
- Exception and Error types should have the "Error" suffix.
|
- Exception and Error types should have the "Error" or "Defect" suffix.
|
||||||
|
|
||||||
.. code-block:: nim
|
.. code-block:: nim
|
||||||
type
|
type
|
||||||
UnluckyError = object of Exception
|
ValueError = object of CatchableError
|
||||||
|
AssertionDefect = object of Defect
|
||||||
|
Foo = object of Exception # bad style, try to inherit CatchableError or Defect
|
||||||
|
|
||||||
- Unless marked with the `{.pure.}` pragma, members of enums should have an
|
- Unless marked with the `{.pure.}` pragma, members of enums should have an
|
||||||
identifying prefix, such as an abbreviation of the enum's name.
|
identifying prefix, such as an abbreviation of the enum's name.
|
||||||
|
|
@ -147,6 +149,8 @@ changed in the future.
|
||||||
an in-place version should get an ``-In`` suffix (``replaceIn`` for this example).
|
an in-place version should get an ``-In`` suffix (``replaceIn`` for this example).
|
||||||
|
|
||||||
|
|
||||||
|
- Use `subjectVerb`, not `verbSubject`, eg: `fileExists`, not `existsFile`.
|
||||||
|
|
||||||
The stdlib API is designed to be **easy to use** and consistent. Ease of use is
|
The stdlib API is designed to be **easy to use** and consistent. Ease of use is
|
||||||
measured by the number of calls to achieve a concrete high level action. The
|
measured by the number of calls to achieve a concrete high level action. The
|
||||||
ultimate goal is that the programmer can *guess* a name.
|
ultimate goal is that the programmer can *guess* a name.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue