命名规范

  1. 命名 范围
    1. git 仓库命名;
    2. 代码项目命名
    3. Unit test 方法命名
      1. 测试object_when特定情况_期望返回结果()
  2. how?
    1. 单一事情
    2. 自解释 & 描述所有的操作 =》如果有备注,then ?修改命名
    3. 全名 而非 缩写
    4. or,and =》只做 一件事情,明确
    5. 同样的操作,使用 统一的词汇。 而非 近义词 =》理解困难
    6. 命名 要 具体, 而非 笼统( object,data,name,value)
    7. 词汇的一致。 start & stop ;beginning & end
  3. 持续rename  & json 添加 atrribute 防止接口的变动
  4. 工具:
    1. 命名建议 CODELF(VS Code,chrome ……):https://unbug.github.io/codelf/#import%20file
    2.  

       

  5. refrence:
    1. https://docs.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions
    2. https://www.c-sharpcorner.com/UploadFile/8a67c0/C-Sharp-coding-standards-and-naming-conventions/
    3. https://github.com/ktaranov/naming-convention/blob/master/C# Coding Standards and Naming Conventions.md

 

posted @ 2022-07-08 16:28  PanPan003  阅读(21)  评论(0编辑  收藏  举报