网站大量收购独家精品文档,联系QQ:2885784924

Lecture11 编程风格的简要说明.pdf

  1. 1、本文档共7页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 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

文档评论(0)

yan698698 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档