mercredi 25 février 2015

Write a (good) code convention for c#

As a relative new trainee in my company, I've been asked to write a code convention since the project is 6 years old and nothing have been done.


Here's the points I came up with:



  1. VARIABLE DECLARATION


    • Position

    • Initialization

    • Naming

    • Types



  2. THE CONDITION BLOCK

    • If

    • If/Else/Else If



  3. LOOPS


    • The For family

    • The ”standard” for loop

    • The ForEach loop

    • The ForEach with LINQ

    • The While and Do/While



  4. THE CLASSES

    • Naming

    • Declaring members

    • Auto Property

    • Read-Only

    • Naming

    • Functions and Methods

    • Naming

    • Arguments



  5. GOOD PRACTICES


    • && and ||

    • Boolean logic

    • New operator

    • Comments

    • Try/Catch




It's not necessary that I details the points, but does the structure/content seems relevant?


Aucun commentaire:

Enregistrer un commentaire