-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GITBOOK-585: update and polish a bit sync modes
- Loading branch information
1 parent
a023430
commit 38c2eae
Showing
5 changed files
with
41 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,35 @@ | ||
--- | ||
description: 'Nethermind C# Coding Style' | ||
description: Nethermind C# Coding Style | ||
--- | ||
|
||
# Coding Style | ||
|
||
## General Rules: | ||
|
||
* We use four spaces for indentation \(not tabs\). | ||
* We use four spaces for indentation (not tabs). | ||
* Do not use Hungarian Notation! | ||
* Avoid more than one empty line at any time. For example, do not have two blank lines between members of a type. | ||
* If a file happens to differ in style from these guidelines \(e.g. private members are named m\_member rather than \_member\), the existing style in that file takes precedence. | ||
* We only use `var` when it's obvious what the variable type is \(e.g. `var stream = new FileStream(...)` not `var stream = OpenStandardInput()`\). | ||
* If a file happens to differ in style from these guidelines (e.g. private members are named m\_member rather than \_member), the existing style in that file takes precedence. | ||
* We only use `var` when it's obvious what the variable type is (e.g. `var stream = new FileStream(...)` not `var stream = OpenStandardInput()`). | ||
* Fields should be specified at the top within type declarations. | ||
* When using a single-statement `if`, we follow these conventions: | ||
* Using braces is always accepted, and required if any block of an if/else if/.../else compound statement uses braces or if a single statement body spans multiple lines. | ||
* Braces may be omitted only if the body of every block associated with an if/else if/.../else compound statement is placed on a single line. | ||
* Braces may be omitted only if the body of every block associated with an if/else if/.../else compound statement is placed on a single line.  | ||
* Avoid complex conditions in ternary operators. | ||
* Avoid declaring methods with more than 5 parameters. Consider refactoring this code. | ||
* Try to replace large parameter-sets \(> than 5 parameters\) with one or more `class` or `struct` parameters – | ||
* Try to replace large parameter-sets (> than 5 parameters) with one or more `class` or `struct` parameters – | ||
|
||
especially when used in multiple method signatures. | ||
especially when used in multiple method signatures.  | ||
* Always call `Close()` or `Dispose()` on classes that offer it.  | ||
* Wrap instantiation of `IDisposable` objects with a “`using`” statement to ensure that Dispose() is | ||
|
||
* Always call `Close()` or `Dispose()` on classes that offer it. | ||
* Wrap instantiation of `IDisposable` objects with a “`using`” statement to ensure that Dispose\(\) is | ||
|
||
automatically called. | ||
|
||
* Always prefer aggregation over inheritance. | ||
automatically called. | ||
* Always prefer aggregation over inheritance.  | ||
|
||
## Naming: | ||
|
||
* We use `camelCase` for local variables and parameters. | ||
* We use `_camelCase` for internal and private fields and use readonly where possible. Prefix internal and private instance fields with `_`, and thread static fields with `t_`. | ||
* We use `snake_case` for test method names. | ||
* We use `IPascalCase` for interfaces names \(see the `I` prefix\). | ||
* We use `IPascalCase` for interfaces names (see the `I` prefix). | ||
* For the rest of identifiers not specified here, we use `PascalCase`. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters