From 31882c6fc2fcd6b507272d99767a8eb6ce39128f Mon Sep 17 00:00:00 2001 From: iSazonov Date: Tue, 3 Oct 2017 12:40:49 +0300 Subject: [PATCH 1/5] Add links on best practice guidelines in coding guideline --- docs/dev-process/coding-guidelines.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/dev-process/coding-guidelines.md b/docs/dev-process/coding-guidelines.md index 6becdb100d8..0674c5783c3 100644 --- a/docs/dev-process/coding-guidelines.md +++ b/docs/dev-process/coding-guidelines.md @@ -180,6 +180,21 @@ See [CODEOWNERS](../../.github/CODEOWNERS) for more information about the area e as it obscures the functional changes of the PR. A separate PR should be submitted for such refactoring without any functional changes. +* Avoid initializing variables, fields and auto-implemented properties to zero or null because C# guarantees its are initialized to zero. + +* Follow Microsoft best practise guidances: + * [Framework Design Guidelines](https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/index) - Naming, Design and Usage guidelines including: + * [Arrays](https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/arrays) + * [Collections](https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/guidelines-for-collections) + * [Exceptions](https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/exceptions) + * [Best Practices for Developing World-Ready Applications](https://docs.microsoft.com/en-us/dotnet/standard/globalization-localization/best-practices-for-developing-world-ready-apps) - Unicode, Culture, Encoding and Localization. + * [Best Practices for System.Net Classes](https://docs.microsoft.com/en-us/dotnet/framework/network-programming/best-practices-for-system-net-classes) + * [Best practices for exceptions](https://docs.microsoft.com/en-us/dotnet/standard/exceptions/best-practices-for-exceptions) + * [Best Practices for Using Strings in .NET](https://docs.microsoft.com/en-us/dotnet/standard/base-types/best-practices-strings) + * [Best Practices for Regular Expressions in .NET](https://docs.microsoft.com/en-us/dotnet/standard/base-types/best-practices) + * [Serialization guidelines](https://docs.microsoft.com/en-us/dotnet/standard/serialization/serialization-guidelines) + * [Managed Threading Best Practices](https://docs.microsoft.com/en-us/dotnet/standard/threading/managed-threading-best-practices) + ## Portable Code There are 3 primary preprocessor macros we use during builds: From 71a2c7fd491189bc029ea5fce6f439d459ed7fed Mon Sep 17 00:00:00 2001 From: iSazonov Date: Tue, 3 Oct 2017 13:04:51 +0300 Subject: [PATCH 2/5] Fix spelling --- .spelling | 1 + 1 file changed, 1 insertion(+) diff --git a/.spelling b/.spelling index 1fd0b26b046..af69e197c7d 100644 --- a/.spelling +++ b/.spelling @@ -518,6 +518,7 @@ p1 interop PaulHigin SMEs +System.Net TravisEz13 uppercase #endregion From b9005813ff6678cce03e95c95e49c0473b7796df Mon Sep 17 00:00:00 2001 From: iSazonov Date: Wed, 4 Oct 2017 09:02:48 +0300 Subject: [PATCH 3/5] Address feedback --- docs/dev-process/coding-guidelines.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/dev-process/coding-guidelines.md b/docs/dev-process/coding-guidelines.md index 0674c5783c3..a7f54a3c79c 100644 --- a/docs/dev-process/coding-guidelines.md +++ b/docs/dev-process/coding-guidelines.md @@ -182,17 +182,19 @@ See [CODEOWNERS](../../.github/CODEOWNERS) for more information about the area e * Avoid initializing variables, fields and auto-implemented properties to zero or null because C# guarantees its are initialized to zero. -* Follow Microsoft best practise guidances: +* Consider using the `Interlocked` class instead of the `lock` statement to atomically change simple states. The `Interlocked` class provides better performance for updates that must be atomic. + +* Here are some useful links for your reference: * [Framework Design Guidelines](https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/index) - Naming, Design and Usage guidelines including: * [Arrays](https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/arrays) * [Collections](https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/guidelines-for-collections) * [Exceptions](https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/exceptions) * [Best Practices for Developing World-Ready Applications](https://docs.microsoft.com/en-us/dotnet/standard/globalization-localization/best-practices-for-developing-world-ready-apps) - Unicode, Culture, Encoding and Localization. * [Best Practices for System.Net Classes](https://docs.microsoft.com/en-us/dotnet/framework/network-programming/best-practices-for-system-net-classes) - * [Best practices for exceptions](https://docs.microsoft.com/en-us/dotnet/standard/exceptions/best-practices-for-exceptions) + * [Best Practices for Exceptions](https://docs.microsoft.com/en-us/dotnet/standard/exceptions/best-practices-for-exceptions) * [Best Practices for Using Strings in .NET](https://docs.microsoft.com/en-us/dotnet/standard/base-types/best-practices-strings) * [Best Practices for Regular Expressions in .NET](https://docs.microsoft.com/en-us/dotnet/standard/base-types/best-practices) - * [Serialization guidelines](https://docs.microsoft.com/en-us/dotnet/standard/serialization/serialization-guidelines) + * [Serialization Guidelines](https://docs.microsoft.com/en-us/dotnet/standard/serialization/serialization-guidelines) * [Managed Threading Best Practices](https://docs.microsoft.com/en-us/dotnet/standard/threading/managed-threading-best-practices) ## Portable Code From 73655255f571754e1bb2b24a665f5a5827c06ac4 Mon Sep 17 00:00:00 2001 From: iSazonov Date: Thu, 5 Oct 2017 08:28:18 +0300 Subject: [PATCH 4/5] Remove unapproved additions --- docs/dev-process/coding-guidelines.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/dev-process/coding-guidelines.md b/docs/dev-process/coding-guidelines.md index a7f54a3c79c..2c0d3947b5f 100644 --- a/docs/dev-process/coding-guidelines.md +++ b/docs/dev-process/coding-guidelines.md @@ -180,8 +180,6 @@ See [CODEOWNERS](../../.github/CODEOWNERS) for more information about the area e as it obscures the functional changes of the PR. A separate PR should be submitted for such refactoring without any functional changes. -* Avoid initializing variables, fields and auto-implemented properties to zero or null because C# guarantees its are initialized to zero. - * Consider using the `Interlocked` class instead of the `lock` statement to atomically change simple states. The `Interlocked` class provides better performance for updates that must be atomic. * Here are some useful links for your reference: @@ -190,7 +188,6 @@ See [CODEOWNERS](../../.github/CODEOWNERS) for more information about the area e * [Collections](https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/guidelines-for-collections) * [Exceptions](https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/exceptions) * [Best Practices for Developing World-Ready Applications](https://docs.microsoft.com/en-us/dotnet/standard/globalization-localization/best-practices-for-developing-world-ready-apps) - Unicode, Culture, Encoding and Localization. - * [Best Practices for System.Net Classes](https://docs.microsoft.com/en-us/dotnet/framework/network-programming/best-practices-for-system-net-classes) * [Best Practices for Exceptions](https://docs.microsoft.com/en-us/dotnet/standard/exceptions/best-practices-for-exceptions) * [Best Practices for Using Strings in .NET](https://docs.microsoft.com/en-us/dotnet/standard/base-types/best-practices-strings) * [Best Practices for Regular Expressions in .NET](https://docs.microsoft.com/en-us/dotnet/standard/base-types/best-practices) From e5e7a996d53bc4c2e5f74346510fc5e1cb5f1041 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 5 Oct 2017 09:27:26 -0700 Subject: [PATCH 5/5] Remove 'System.NET' as it's been removed from doc --- .spelling | 1 - 1 file changed, 1 deletion(-) diff --git a/.spelling b/.spelling index af69e197c7d..1fd0b26b046 100644 --- a/.spelling +++ b/.spelling @@ -518,7 +518,6 @@ p1 interop PaulHigin SMEs -System.Net TravisEz13 uppercase #endregion