命名规范

  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 @   PanPan003  阅读(24)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· 没有源码,如何修改代码逻辑?
· NetPad:一个.NET开源、跨平台的C#编辑器
· 面试官:你是如何进行SQL调优的?
历史上的今天:
2020-07-08 .net framework 运行 xunit单元测试
2016-07-08 5.Primitive, Reference, and Value Types
点击右上角即可分享
微信分享提示