Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Toub <stoub@microsoft.com>2016-02-19 07:29:16 +0300
committerStephen Toub <stoub@microsoft.com>2016-02-19 07:29:16 +0300
commit531abfd26b84dd40404762bbeed503b133b3b8db (patch)
treeaa1e0781708c8bb101f2bafa37b41326ce8bcdff /Documentation/coding-guidelines
parentf8084e05172d089e466af5ccc2013e0159bad1c1 (diff)
Update coding-style.md
Diffstat (limited to 'Documentation/coding-guidelines')
-rw-r--r--Documentation/coding-guidelines/coding-style.md7
1 files changed, 3 insertions, 4 deletions
diff --git a/Documentation/coding-guidelines/coding-style.md b/Documentation/coding-guidelines/coding-style.md
index 79feedb502..dbd895c4fc 100644
--- a/Documentation/coding-guidelines/coding-style.md
+++ b/Documentation/coding-guidelines/coding-style.md
@@ -15,8 +15,7 @@ The general rule we follow is "use Visual Studio defaults".
`private string _foo` not `string _foo`). Visibility should be the first modifier (i.e.
`public abstract` not `abstract public`).
6. Namespace imports should be specified at the top of the file, *outside* of
- `namespace` declarations and should be sorted alphabetically, with `System.`
- namespaces at the top and blank lines between different top level groups.
+ `namespace` declarations and should be sorted alphabetically.
7. Avoid more than one empty line at any time. For example, do not have two
blank lines between members of a type.
8. Avoid spurious free spaces.
@@ -27,6 +26,7 @@ The general rule we follow is "use Visual Studio defaults".
10. We only use `var` when it's obvious what the variable type is (i.e. `var stream = new FileStream(...)` not `var stream = OpenStandardInput()`).
11. We use language keywords instead of BCL types (i.e. `int, string, float` instead of `Int32, String, Single`, etc) for both type references as well as method calls (i.e. `int.Parse` instead of `Int32.Parse`). See issue [391](https://github.com/dotnet/corefx/issues/391) for examples.
12. We use PascalCasing to name all our constant local variables and fields. The only exception is for interop code where the constant value should exactly match the name and value of the code you are calling via interop.
+13. We use ```nameof(...)``` instead of ```"..."``` whenever possible and relevant.
We have provided a Visual Studio 2013 vssettings file (`corefx.vssettings`) at the root of the corefx repository, enabling C# auto-formatting conforming to the above guidelines. Note that rules 7 and 8 are not covered by the vssettings, since these are not rules currently supported by VS formatting.
@@ -43,7 +43,6 @@ using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics;
-
using Microsoft.Win32;
namespace System.Collections.Generic
@@ -56,7 +55,7 @@ namespace System.Collections.Generic
public ObservableLinkedList(IEnumerable<T> items)
{
if (items == null)
- throw new ArgumentException("items");
+ throw new ArgumentException(nameof(items));
foreach (T item in items)
{