Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement and Standardize Code Commenting Guidelines #156

Open
4 tasks
0x1026 opened this issue Nov 30, 2024 · 0 comments
Open
4 tasks

Implement and Standardize Code Commenting Guidelines #156

0x1026 opened this issue Nov 30, 2024 · 0 comments
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/docs Categorizes issue or PR as related to documentation. kind/improvement Categorizes issue or PR as related to an improvement. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@0x1026
Copy link
Member

0x1026 commented Nov 30, 2024

Effective commenting is essential for maintaining clarity and collaboration in the project. This issue focuses on adding consistent, meaningful comments to the codebase and establishing guidelines for future development.

Tasks

  • Establish Commenting Guidelines
    • Define a standard style for comments, including:
      • File headers.
      • Function/method documentation using tools like PHPDoc.
      • Inline comments for non-obvious or complex logic.
      • Section comments to organize code blocks.
    • Document the commenting standards in a shared guideline for team use.
  • Add Comments to Existing Code
    • Review the codebase to:
      • Add file header comments explaining the file's purpose and authorship.
      • Document functions and methods with clear explanations of inputs, outputs, and logic.
      • Add inline comments for complex logic and critical decisions.
    • Ensure all comments are clear, concise, and reflect the current state of the code.
  • Validate Comments
    • Review the comments to ensure they:
      • Are meaningful and not redundant.
      • Use proper grammar and spelling.
      • Follow the agreed-upon standards.
  • Integrate Commenting into Development Workflow
    • Include a step in code reviews to check for proper commenting.
    • Encourage developers to update comments whenever code is modified.

Examples of Standardized Comments

File Header Comment

/*  
 * File: user_auth.php  
 * Description: Handles user authentication processes.  
 * Author: Class A  
 * Date: November 2024  
 */  

Function Documentation

/**  
 * Sends a welcome email to a new user.  
 *  
 * @param string $email The user's email address.  
 * @return bool True if the email was sent successfully.  
 */  
function sendWelcomeEmail($email) {  
    // Logic here  
}  

Section Header Comment

// ==========================  
// User Authentication Logic  
// ==========================  

Considerations

  • Avoid over-commenting or redundant comments that merely repeat what the code does.
  • Ensure comments are updated whenever related code is changed.
  • Use comments to explain why the code exists, not just what it does (unless the logic is complex).
@0x1026 0x1026 added kind/docs Categorizes issue or PR as related to documentation. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. triage/accepted Indicates an issue or PR is ready to be actively worked on. kind/improvement Categorizes issue or PR as related to an improvement. labels Nov 30, 2024
@0x1026 0x1026 added this to the Sprint 3 - Prototype milestone Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/docs Categorizes issue or PR as related to documentation. kind/improvement Categorizes issue or PR as related to an improvement. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: Pendent
Development

No branches or pull requests

2 participants