mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 13:30:33 +00:00
nep1: use subjectVerb, not verbSuject (#14732)
This commit is contained in:
@@ -101,11 +101,13 @@ changed in the future.
|
||||
fd: int64
|
||||
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
|
||||
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
|
||||
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).
|
||||
|
||||
|
||||
- Use `subjectVerb`, not `verbSubject`, eg: `fileExists`, not `existsFile`.
|
||||
|
||||
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
|
||||
ultimate goal is that the programmer can *guess* a name.
|
||||
|
||||
Reference in New Issue
Block a user