Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Src/Cheatsheet/Cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ NOTE: Requires Markdown Extra. See http://michelf.ca/projects/php-markdown/extra
* Name types using nouns, noun phrases or adjective phrases (AV1708)
* Don’t repeat the name of a class or enumeration in its members (AV1710)
* Avoid short names or names that can be mistaken with other names (AV1712)
* Name methods using verb-object pair (AV1720)
* Name methods and local functions using verbs or verb-object pairs (AV1720)
Copy link
Copy Markdown
Owner

@dennisdoomen dennisdoomen Oct 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, when would a local function be named using just a verb?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I consider LFs similar to methods in that they perform an operation. Examples would then be: Initialize/InitializeFields, Prepare/PrepareDocument, Calculate/CalculateSalesRates, Reassign/ReassignWork etc.

* Name namespaces using names, layers, verbs and features (AV1725)
</td>
<td class="column">
Expand Down
6 changes: 3 additions & 3 deletions Src/Guidelines/1700_NamingGuidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ Although technically correct, statements like the following can be confusing:
- Consider prefixing boolean properties with `Is`, `Has`, `Can`, `Allows`, or `Supports`.
- Consider giving a property the same name as its type. When you have a property that is strongly typed to an enumeration, the name of the property can be the same as the name of the enumeration. For example, if you have an enumeration named `CacheLevel`, a property that returns one of its values can also be named `CacheLevel`.

### <a name="av1720"></a> Name methods using a verb or a verb-object pair (AV1720) ![](images/2.png)
Name methods using a verb like `Show` or a verb-object pair such as `ShowDialog`. A good name should give a hint on the *what* of a member, and if possible, the *why*.
### <a name="av1720"></a> Name methods and local functions using verbs or verb-object pairs (AV1720) ![](images/2.png)
Name a method or local function using a verb like `Show` or a verb-object pair such as `ShowDialog`. A good name should give a hint on the *what* of a member, and if possible, the *why*.

Also, don't include `And` in the name of a method. It implies that the method is doing more than one thing, which violates the single responsibility principle explained in AV1115.
Also, don't include `And` in the name of a method or local function. That implies that it is doing more than one thing, which violates the Single Responsibility Principle explained in AV1115.

### <a name="av1725"></a> Name namespaces using names, layers, verbs and features (AV1725) ![](images/3.png)
For instance, the following namespaces are good examples of that guideline.
Expand Down