Tho we can use a Style Guide of a company like Google, i think its better to keep rules simpler in our case so i have simplified some of the guidelines for Code readability below:

Code can be read, even by a beginner- The code will be maintained not by us but by our juniors in the future so it is necessary that they are able to understand the code, below are some of the Style Guideline for the code.

  1. Naming convention

  2. Use meaningful and descriptive names for variables, functions and classes Example: ‘calculateTotalScore()’ insted of calcTotal() 'studentCounter insted of 'sc'

  3. Variable and Functions should be in camelCase - calculateTotalScore() Classes PascalCase - StudentProfile Constant - UPPER_SNAKE_CASE - MAX_VALUE = 100

  4. Code Structure and formatting

    1. Limit line length to 80 - 100 characters
    2. Consistent Indentation - 2 spaces for JS/TS | 4 spaces for python
    3. Use blank lines to separate different sections of a code (2 blank lines after a class definition, 1 after a function, 1 to separate different logical components)
  5. Function Design

    1. Keep functions focused on a single tasks
    2. Avoid Deeply nested structures, make more functions to reduce nesting

    For example: If we want to check structure of user input, its validity and process it, all 3 of them should be done by separate functions instead of a single one

  6. Include Code comments

    1. At start of each of file write comments specifying what is the purpose of the file, what is contained the file
    2. At start of each function write what that function does and why.
    3. Also clearly specify input and output format for any functions / Methods
    4. At start of each class clearly specify the important functions and purpose of the class
    5. Contributors at start of each file
  7. Git Commit / Pull Request Messages

    Use Clear, meaningful messages:

    Title

    fix; Resolved login bug when username has special characters

    feat: Added Events section to the homepage

    Chore

    Breaking Change

    docs

    style

    Refactor

    Followed by a one line description of the commit

    In depth Description in the body