Skip to content

Updated to include local functions#117

Merged
dennisdoomen merged 2 commits into
dennisdoomen:masterfrom
bkoelman:AV1725
Oct 25, 2017
Merged

Updated to include local functions#117
dennisdoomen merged 2 commits into
dennisdoomen:masterfrom
bkoelman:AV1725

Conversation

@bkoelman
Copy link
Copy Markdown
Contributor

Fixes #108.

* 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.

Comment thread Src/Guidelines/1700_NamingGuidelines.md Outdated
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.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Also capitalize the SRP.

Copy link
Copy Markdown
Contributor Author

@bkoelman bkoelman Oct 25, 2017

Choose a reason for hiding this comment

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

Sure, will update. #resolved

@dennisdoomen dennisdoomen merged commit 66c7951 into dennisdoomen:master Oct 25, 2017
@bkoelman bkoelman deleted the AV1725 branch October 25, 2017 14:29
mapfel pushed a commit to stepahead/CSharpGuidelines that referenced this pull request Mar 22, 2021
* Updated to include local functions

* caps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants