sunnydl / GamePerformanceTracker

Team project for CSE 115A in Fall 2021, UCSC
3 stars 0 forks source link

Refactor codes if needed for meeting coding standard #84

Closed sunnydl closed 2 years ago

sunnydl commented 2 years ago

The coding standard we will be following will mainly be:

  1. Each function needs to have comments such as following
    /**
    * Returns x raised to the n-th power.
    *
    * @param {number} x The number to raise.
    * @param {number} n The power, must be a natural number.
    * @return {number} x raised to the n-th power.
    */
    const pow = (x: number, n: number) => {
      // do something to x
      return x as number;
    }
  2. If found repetitiveness in codes, try to reduce the block to a single function and replace the repetitive blocks with that function.
  3. Naming of the function and variables has to be intuitive, makes sense, and not too long.
  4. Remove unused variables, and functions.

Each of us should check the code we wrote and make the change individually, after the change, make sure to check if the feature is still working, and after that, it can be pushed to the master branch directly.