- 1
- 0
- 约8.38千字
- 约 10页
- 2023-01-05 发布于湖北
- 举报
一般约定
Genaral Principles
1.Adhere to the style of the original.
保持最初的样式。
2.Adhere to the Principle of Least Astonishment.
遵守最小惊奇原则。
3.Do it right the first time.
第一次就应当做好。
4.Document any deviations.
对于任何背离都应当文档注释。
格式约定
Formatting Conventions
5.Indent nested code.
6.Break up long lines.
7.Include white space.
8.Do not use hard tabs.
不要使用 tab 键。
命名约定
Naming Conventions
9.Use meaningful names.
使用有意义的名称。
10.Use familiar names.
使用熟悉的名称。
11.Question excessively long names.
不要使用过长的名称。
12.Join the vowel generation.
13.Capitalize only the first letter in acronyms.
14.Do not use names that differ only in case.
不要使用只依赖于大小写来区分的名称。
包命名
Package Names
15.Use the reversed, lowercase form of your organizations Internet domain name as the root qualifier
for your package names.
采用你组织的 Internet 域名的反转、小写形式作为包名称的根限定词。
16.Use a single, lowercase word as the root name of each package.
17.Use the same name for a new version of a package, but only if that new version is still binary
compatible with the previous versin, otherwise, use a new name.
只有当包的新版本仍然与旧版本兼容时,对于包的新版本使用相同的名称,否则使用新名称。
类型命名
Type Names
18.Capitalize the first letter of each word that appears in a class or interface name.
对于类和接口名称只对每个单词的第一个字母大写。
类命名
Class Names
19.Use nouns when naming classes.
20.Pluralize the names of classes that group related attributes, static services, or constants.
对于成组的相关属性、静态服务和常量,类名称采用复数形式。
接口命名
Interface Names
21.Use nouns or adjectives when naming interfaces.
使用名词或形容词来命名接口。
方法命名
Method Names
22.Use lowercase for the first word and capitalize only the first letter of each subsequent word that
appears in a method name.]
方法名称中第一个单词小写,后续的每一个单词仅第一个字母大写。
23.Use verbs when naming methods.
24.Follow the JavaBeans conventions for naming property accessor methods.
命名属性访问方法遵守 JavaBeans 约定。
变量命名
Variable Names
25.Use lowercase for the first word and capitalize only the first letter of each subsequent word that
appears in a variable name.
变量名称中第一个单词小写,后续的每一个单词仅第一个字母大写。
26.Use nouns to name fields.
使用名词来命名成员变量。
您可能关注的文档
- 《车库建筑设计规范》JGJ 100-2015.docx
- 027、操作箱手套清洗、灭菌及使用标准操作规程.docx
- 2015最新工程勘察设计所使用的标准和书籍汇总.docx
- 2016 年度全国注册土木工程师(岩土)专业考试所使用的标准和法律法规.docx
- APP应用开发的设计规范与标准.docx
- BYD 电动汽车用充电柜及充电桩.docx
- DB11 693-2009 建设工程临建房屋应用技术标准.docx
- DIN25201防松垫圈标准及使用.docx
- DL T 664-2008红外诊断应用规范.docx
- GB 713-2008《锅炉和压力容器用钢》讲义.docx
- 党组书记2025年民主生活会对照检查汇编(5篇).docx
- 2026年中考历史总复习三年真题汇编专题23 封建时代的欧洲和亚洲国家(原卷版).docx
- 2026年中考历史总复习第一部分教材知识梳理模块二中国近代史主题七人民解放战争.pptx
- 2026年中考历史总复习第一部分教材知识梳理模块三中国现代史主题一中华人民共和国的成立和巩固.pptx
- 2026年中考道德与法治总复习第一部分考点梳理九年级上册第三单元文明与家园第五课守望精神家园.pptx
- 2026年中考历史总复习第一部分教材知识梳理模块四世界古代史主题三封建时代的欧洲.pptx
- 2026年中考道德与法治总复习三年真题专题09 走进社会生活(学生版).docx
- 2026年中考历史总复习三年真题汇编专题17 社会主义制度的建立与社会主义建设的探索(原卷版).docx
- 2026年中考道德与法治总复习考点培优七年级上册.docx
- 2026年中考道德与法治总复习第一部分考点梳理九年级上册第二单元民主与法治.pptx
最近下载
- 2021一级消防工程师继续教育考试石油化工类答案 .pdf VIP
- 中考模拟试卷二.docx VIP
- T_SDJSXH 08-2024 智能施工升降机安全技术规程.pdf VIP
- 欠条模板 (2)PDF打印.pdf VIP
- DZT0151-2015 区域地质调查中遥感技术规定(1:50000).pdf VIP
- 【验收报告】项目验收报告.docx VIP
- 原子物理学第二章.ppt VIP
- 内部控制审计【外文翻译】.pdf VIP
- 德斯勒 人力资源管理(英文版第15版) 课件Dessler15e_HRM_Ch07.pptx VIP
- 2025年中小学生寒假安全教育主题班会PPT课件.pptx VIP
原创力文档

文档评论(0)