zoukankan      html  css  js  c++  java
  • C Sharp Coding Standards

    Naming Conventions

    • “c” = camelCase
    • “P” = PascalCase
    • “_” = Prefix with _Underscore
    • “x” = Not Applicable.
    IdentifierPublicProtectedInternalPrivateNotes
    Project File P x x x Match Assembly & Namespace.
    Source File P x x x Match contained class.
    Other Files P x x x Apply where possible.
    Namespace P x x x Partial Project/Assembly match.
    Class or Struct P P P P Add suffix of subclass.
    Interface P P P P Prefix with a capital I.
    Generic Class 
    [C#v2+]
    P P P P Use T or K as Type identifier.
    Method P P P P Use a Verb or Verb-Object pair.
    Property P P P P Do not prefix with Get or Set.
    Field P P P _c Only use Private fields. 
    No Hungarian Notation!
    Constant P P P _c  
    Static Field P P P _c Only use Private fields.
    Enum P P P P Options are also PascalCase.
    Delegate P P P P  
    Event P P P P  
    Inline Variable x x x c Avoid single-character and enumerated names.
    Parameter x x x c  
  • 相关阅读:
    [包计划] date-fns
    [包计划] create-react-app
    [包计划] js-cookie
    [包计划] cheerio
    [包计划] 30-seconds-of-code
    new
    [源计划] array-first
    [源计划] is-sorted
    [源计划] array-flatten
    images
  • 原文地址:https://www.cnblogs.com/hyb1/p/3046860.html
Copyright © 2011-2022 走看看