Skip to content
Merged
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
4 changes: 2 additions & 2 deletions _pages/1700_NamingGuidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ In most cases they are a lazy excuse for not defining a clear and intention-reve
For example, don't use `g_` or `s_` to distinguish static from non-static fields. A method in which it is difficult to distinguish local variables from member fields is generally too big. Examples of incorrect identifier names are: `_currentUser`, `mUserName`, `m_loginTime`.

### <a name="av1706"></a> Don't use abbreviations (AV1706) ![](/assets/images/2.png)
For example, use `OnButtonClick` rather than `OnBtnClick`. Avoid single character variable names, such as `i` or `q`. Use `index` or `query` instead.
For example, use `ButtonOnClick` rather than `BtnOnClick`. Avoid single character variable names, such as `i` or `q`. Use `index` or `query` instead.

**Exceptions:** Use well-known acronyms and abbreviations that are widely accepted or well-known in your work domain. For instance, use acronym `UI` instead of `UserInterface` and abbreviation `Id` instead of `Identity`.

Expand Down Expand Up @@ -137,7 +137,7 @@ Suppose you want to define events related to the deletion of an object. Avoid de
- `Deleted`: Occurs when the object is already deleted.

### <a name="av1738"></a> Prefix an event handler with "On" (AV1738) ![](/assets/images/3.png)
It is good practice to prefix the method that handles an event with "On". For example, a method that handles the `Closing` event can be named `OnClosing`.
It is good practice to prefix the method that handles an event with "On". For example, a method that handles its own `Closing` event should be named `OnClosing`. And a method that handles the `Click` event of its `okButton` field should be named `OkButtonOnClick`.

### <a name="av1739"></a> Use an underscore for irrelevant parameters (AV1739) ![](/assets/images/3.png)
If you use a lambda expression (for instance, to subscribe to an event) and the actual arguments of the event are irrelevant, use discards to make that explicit:
Expand Down