Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ See the landing page at https://www.csharpcodingguidelines.com

## How to create the PDFs

1. From the root of the repo, run the `build.ps1` script to build the HTML versions of the guidelines and cheat sheet.
2. From the `Artifacts` folder, open the `CSharpCodingGuidelines.htm` into your favorite browser and print as PDF. Use the default margins, no headers and footers, and set the scaling to 80% for A4 sheets.
3. Do the same for the `CSharpCodingGuidelinesCheatsheet.htm`, but use landscape orientation and minimum margins. A scaling of 84% should allow you to print the cheat sheet as a double-sided A4 sheet. Just make sure you disable headers and footers, and enable printing background graphics to keep the colored boxes with auxiliary information.

Now open them in
1. From the root of the repo, run the `build.bat` script to build the HTML versions of the guidelines and cheat sheet.
2. From the `Artifacts` folder, open the `CSharpCodingGuidelines.htm` into your favorite browser and print as PDF. Use the default margins, no headers and footers, and set the scaling to 80% for A4 sheets.
3. Do the same for the `CSharpCodingGuidelinesCheatsheet.htm`, but use landscape orientation and minimum margins. A scaling of 84% should allow you to print the cheat sheet as a double-sided A4 sheet. Just make sure you disable headers and footers, and enable printing background graphics to keep the colored boxes with auxiliary information.

## How to build this site

Expand Down
2 changes: 1 addition & 1 deletion _includes/0001_Introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This document attempts to provide guidelines (or coding standards if you like) f
Although some might see coding guidelines as undesired overhead or something that limits creativity, this approach has already proven its value for many years. This is because not every developer:

- is aware that code is generally read 10 times more than it is changed;
- is aware of the potential pitfalls of certain constructions in C#;
- is aware of the potential pitfalls of certain constructs in C#;
- is up to speed on certain conventions when using the .NET Framework such as `IDisposable`, `async`/`await`, or the deferred execution nature of LINQ;
- is aware of the impact of using (or neglecting to use) particular solutions on aspects like security, performance, multi-language support, etc;
- realizes that not every developer is as capable, skilled or experienced to understand elegant, but potentially very abstract solutions;
Expand Down
2 changes: 1 addition & 1 deletion _pages/1100_MemberDesignGuidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Similarly to rule [AV1000](/class-design-guidelines#av1000), a method body shoul

### <a name="av1125"></a> Don't expose stateful objects through static members (AV1125) ![](/assets/images/2.png)

A stateful object is an object that contains many properties and lots of behavior behind it. If you expose such an object through a static property or method of some other object, it will be very difficult to refactor or unit test a class that relies on such a stateful object. In general, introducing a construction like that is a great example of violating many of the guidelines of this chapter.
A stateful object is an object that contains many properties and lots of behavior behind it. If you expose such an object through a static property or method of some other object, it will be very difficult to refactor or unit test a class that relies on such a stateful object. In general, introducing a construct like that is a great example of violating many of the guidelines of this chapter.

A classic example of this is the `HttpContext.Current` property, part of ASP.NET. Many see the `HttpContext` class as a source of a lot of ugly code. In fact, the testing guideline [Isolate the Ugly Stuff](http://codebetter.com/jeremymiller/2005/10/21/haacked-on-tdd-and-jeremys-first-rule-of-tdd/) often refers to this class.

Expand Down
2 changes: 1 addition & 1 deletion _pages/2400_LayoutGuidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ sidebar:
// Microsoft namespaces are first
using System;
using System.Collections.Generic;
using System.XML;
using System.Xml;

// Then any other namespaces in alphabetic order
using AvivaSolutions.Business;
Expand Down