Back to Web Dev For Beginners

Comment Your Code

6-space-game/3-moving-elements-around/assignment.md

latest1.8 KB
Original Source

Comment Your Code

Instructions

Clean, well-documented code is essential for maintaining and sharing your projects. In this assignment, you'll practice one of the most important habits of professional developers: writing clear, helpful comments that explain your code's purpose and functionality.

Go over your current app.js file in your game folder, and find ways to comment it and tidy it up. It's very easy for code to get out of control, and now's a good chance to add comments to ensure that you have readable code so that you can use it later.

Your task includes:

  • Add comments explaining what each major section of code does
  • Document functions with clear descriptions of their purpose and parameters
  • Organize code into logical blocks with section headers
  • Remove any unused or redundant code
  • Use consistent naming conventions for variables and functions

Rubric

CriteriaExemplaryAdequateNeeds Improvement
Code Documentationapp.js code is fully commented with clear, helpful explanations for all major sections and functionsapp.js code is adequately commented with basic explanations for most sectionsapp.js code has minimal comments and lacks clear explanations
Code OrganizationCode is organized into logical blocks with clear section headers and consistent structureCode has some organization with basic grouping of related functionalityCode is somewhat disorganized and difficult to follow
Code QualityAll variables and functions use descriptive names, no unused code, follows consistent conventionsMost code follows good naming practices with minimal unused codeVariable names are unclear, contains unused code, inconsistent style