- 1、本文档共7页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Lecture11 编程风格的简要说明
编程风格的简要说明
2013/10/21 软件学院软件工程教研室 1
编程风格和文档
• 编程风格决定程序外观
• Appropriate Comments适当的注释
• Naming Conventions命名习惯
• Proper Indentation and Spacing Lines适当的缩进和空白
• Block Styles块的对齐方式
2013/10/21 软件学院软件工程教研室 2
Appropriate Comments
• Include a summary at the beginning of the program to explain
what the program does, its key features, its supporting data
structures, and any unique techniques it uses.
• Include your name, class section, instruction, date, and a brief
description at the beginning of the program.
2013/10/21 软件学院软件工程教研室 3
Naming Conventions
• Choose meaning and descriptive names.
•Variables and method names:
• Use lowercase. If the name consists of several words, concatenate all
in one, use lowercase for the first word, and capitalize the first letter of
each subsequent word in the name. For example, the variables radius
and area, and the method computeArea.
2013/10/21 软件学院软件工程教研室 4
Naming Conventions, cont.
• Class names:
• Capitalize the first letter of each word in the name. For example, the
class name ComputeArea.
• Constants:
• Capitalize all letters in constants. For example, the constant PI.
2013/10/21 软件学院软件工程教研室 5
Proper Indentation and Spacing
• Indentation
• Indent two spaces.
• Spacing
• Use blank line to separate segments of the code.
2013/10/21 软件学院软件工程教研室 6
Block Styles
• next-line 次行风格
• end-of-line行尾风格
2013/10/21 软件学院软件工程教研室 7
您可能关注的文档
- wrf模式学习_从linux安装开始.pdf
- DELL Latitude商用笔记本系列产品.pdf
- TRANSFIX 系列安装手册(中文版V1.0).pdf
- orthophos xg系列.pdf
- 升压芯片-TPS系列.pdf
- 柯林斯轻松学系列——西班牙语分类词汇.pdf
- NUC100中文手册.pdf
- Actel FPGA选型基础资料.pdf
- PET质粒图谱大全.pdf
- 英文儿歌_顺口溜.pdf
- 二零二五版!借款合同模板!附借据!.docx
- 2025年河南省信阳市罗山县高三下学期3月联考数学试卷.docx
- 2025年河南省信阳市罗山县高三一模数学试卷及答案.docx
- 2025年河南省信阳市潢川县高三下学期考前数学适应性演练(二)试题.docx
- 2025年河南省信阳市潢川县高三下学期3月联考数学试卷.docx
- 2025年河南省信阳市潢川县高三二模数学试卷及答案.docx
- 十五章电流电路作业课件节两种电荷.pptx
- 2025年河南省信阳市淮滨县高三下学期考前数学适应性演练(二)试题.docx
- 2025年河南省信阳市淮滨县高三二模数学试卷及答案.docx
- 《计算机系统基础:注册表篇》课件.ppt
文档评论(0)