zoukankan      html  css  js  c++  java
  • C# 中的命名规则

    需要注意:

    C# 区分大小写 ,若有int a 和 int A ,则a, 和 A是不同的

    普通字段,属相,方法,类的命名规则:

    C#中推荐使用  camelCasing ,和 PascalCasing 两种形式对复合单词进行命名。

    加入有个复合单词由单词 “student” 和 “"name"组成, 则

    • camelCasing 格式为:  studentName
    • PascalCasing 格式为:  StudentName

    对于命名的基本规则如下:

      1. 若是 Public开头,则用 Pascal命名  eg: StudentName
      2. 若是Private开头,则用Camel命名  eg: studentName

    eg:

    Public string StudentName;
    private string studentName;
    
    
    public class MyClass
    {
    public readonly string Name;
    private int intVal;
    public int Val
    }

    项目的命名规则:

    一般项目的命名微软推荐我们采用以下格式:

    •  公司吗.项目名.类名

    eg:Microsoft.PetShop.Bird

    说明:

    Microsoft 为公司名

    PetShop 为项目名

    Bird 为PetShop 项目中的一个类名

  • 相关阅读:
    小程序模板
    小程序 if else
    小程序入门小知识
    懒加载
    展示效果
    五星评价
    萤火虫效果
    下雪效果
    选项卡
    VUE组件中 data 里面的数据为什么要return 出来
  • 原文地址:https://www.cnblogs.com/TangPro/p/3240313.html
Copyright © 2011-2022 走看看