|
Post by account_disabled on Apr 4, 2024 11:46:56 GMT 2
如果函数有多个未使用的参数请使用额外的下划线以避免名称冲突等。操作完成。本指南仅适用于匿名函数和本地函数。这些函数通常直接在明确未使用参数代表什么的上下文中使用。相反顶级函数和方法声明没有这样的上下文因此必须对它们的参数进行命名以便清楚每个参数的作用即使它没有被使用。不要对非私有标识符使用前导下划线在标识符中使用前导下划线将顶级元素和声明标记为私有。这可以训练用户将前导下划线与其中一种广告类型相关联。 他们看到并认为私有。局部变量参数局部函数或库前缀没有私有的概念。当其中一个的名称以下划线开头时就会向读者发出令人 阿曼数据 困惑的信息。为了避免这种情况请勿在这些名称中使用前导下划线。不要使用前缀字母匈牙利表示法和其他方案起源于时代当时编译器几乎无法帮助您理解代码。由于可以告诉您声明的类型范围可变性和其他属性因此没有属性进行编码。好的不好的不要给库明确的名称向库指令添加名称在技术上是可行的但这是一个已弃用的功能不建议这样做。 根据每个库的路径和文件名生成一个唯一的标签。命名库会覆盖此生成的。如果没有工具可能会更难以找到有问题的主库文件。糟糕的库好一个非常棒的测试库。浏览器库为了保持文件序言中的顺序我们规定了指令必须出现的顺序。每个部分必须用空行分隔。一项布局规则可处理所有排序建议。务必将导入放在其他导入之前规则导入导入包导入地点套餐在其他导入之前导入规则导入导入请在所有导入之后在单独的部分中列出导出规则导入导出错误导入导出导入请按字母顺序对节进行。
|
|