NoFantasy—— Beta Code Standards

NoFantasy 2024-12-20 23:32:50
Course for This Assignment2401_MU_SE_FZU
Team NameNoFantasy
Assignment RequirementsTeamwork—beta Spring
Objectives of This AssignmentBeta Sprint
Other ReferencesNo Reference

Code Standards

Front:[Front-end code specification]

Back:[Back-end code specification]

  1. Readability:
    • Use parentheses to explicitly define operator priorities and avoid relying on default precedence.
    • Keep related code closely grouped to maintain logical continuity.
    • Only use complex sentences when absolutely necessary to avoid over-complicating the code.
  2. Statement Writing:
    • Break long parameter lists in functions or procedures into multiple lines for better readability.
    • Ensure proper indentation in all files, aligning left and right parentheses correctly.
    • Add spaces around operators when multiple keywords, variables, or constants are involved to improve clarity.
  3. Comments and Annotations:
    • Ensure that at least 20% of the source code is annotated.
    • Write comments while coding, and update comments when modifying code to ensure consistency.
    • Comments should be clear, concise, and accurate, avoiding ambiguity.
    • Avoid abbreviations in comments, especially overly short terms.
    • Place comments either above or to the right of the corresponding code (for single statements). Do not place comments below the code.
    • Add blank lines between comments and code when comments are placed above the code.
    • Annotate data structure declarations near their definition, with each field commented to the right.
    • Provide detailed comments for global variables, including their function, value range, and considerations for access.
    • Indent annotations consistently to match the surrounding code structure.
    • Add comments to variable definitions and branch statements (e.g., conditionals and loops) while avoiding inline comments.
  4. Identifier Naming:
    • Use clear and meaningful names for identifiers, avoiding single-character names (except for local loop variables like i, j, or k).
    • Document special naming conventions or abbreviations for clarity.
    • Maintain a consistent naming style throughout the project.
    • Follow established naming conventions within the project and avoid mixing uppercase and underscores.
    • Avoid using numbers or unusual characters in identifiers unless absolutely necessary.
    • Use appropriate antonyms for naming variables with opposite meanings or functions.
    • Avoid identifiers that begin or end with underscores.
...全文
57 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

170

社区成员

发帖
与我相关
我的任务
社区描述
2401_MU_SE_FZU
软件工程 高校
社区管理员
  • FZU_SE_TeacherL
  • 助教-吴可仪
  • 助教-孔志豪
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧