Giter VIP home page Giter VIP logo

csharpguidelines's Introduction

Coding Guidelines for C# 3.0, 4.0 and 5.0

Join the chat at https://gitter.im/dennisdoomen/csharpguidelines Build status

What is this

This document attempts to provide guidelines (or coding standards if you like) for coding in C# 3.0, 4.0 or 5.0 that are both useful and pragmatic. Of course, if you create such a document you should practice what you preach. So rest assured, these guidelines are representative to what we at Aviva Solutions do in our day-to-day work. Notice that not all guidelines have a clear rationale. Some of them are simply choices we made at Aviva Solutions. In the end, it doesn't matter what choice you made, as long as you make one and apply it consistently.

Why would you use this document?

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 up to speed on certain conventions when using the .NET Framework such as IDisposable 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;

Where do I get them?

Go to the Releases page to find the latest HTML, PDF and other related files.

Can I create my own version?

Absolutely. The corresponding license allows you to fork, adapt and distribute that modified version within your organization as long as you refer back to the original version here. It's not required, but you would make me a very happy man if you credit me as the original author. And if you have any great ideas, recommendations or corrections, either submit an issue, or even better, fork the repository and provide me with a pull request. Just run the following command-line to compile the Markdown versions of the guidelines and cheatsheet to self-contained HTML files.

build.bat

Are there any other languages available?

Yes, Sergey Russkikh maintains a Russian translation through his fork.

Is there tooling support?

A code analyzer that verifies over 40 of these guidelines is available at https://github.com/bkoelman/CSharpGuidelinesAnalyzer. This open source tool can be run during CI builds or while typing code in Visual Studio 2015/2017. An updated Resharper settings file is included.

csharpguidelines's People

Contributors

dennisdoomen avatar bkoelman avatar adamvoss avatar alexendris avatar 9034725985 avatar luiscoelho avatar robvanuden avatar gitter-badger avatar cocowalla avatar s-tarasov avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.