Coder Social home page Coder Social logo

game-code-review's Introduction

Game Code Review & Refactor

Code Smells

  • Excessive Comments
  • Dead Code (e.g. commmented-out, or completely unused code)
  • Long Methods / Large Classes
  • Inconsistent Naming
  • Uncommunicative Naming
  • Long Parameter Lists
  • Inconsistent Interfaces
  • Duplicated code
  • Complex Conditionals
  • Combinitorial Explosion
  • Speculative Generality (aka "premature optimization")
  • Inappropriate Intimacy (aka "entangled code")

Source: List of Code Smells

Javascript Style Guide

Airbnb ES5 Style Guide

Code Review

Take a look at the three Game solutions in this repo.

  • What did they do well?
    • Good style
    • Helpful comments about complex logic
    • Indentation, Spacing
    • Good variable names & function names
  • What could they refactor?
    • Code "smells"
    • Don't Repeat Yourself (DRY)
      • Modularity / Encapsulation / Abstraction
    • Keep it Simple, Stupid (KISS)
      • "Premature optimization is the root of all evil" -- Donald Knuth
    • Separation of Concerns (SoC)
      • Model View Controller (MVC)
        • Model Logic (Data) - e.g. player 1, player 2
        • View Logic (Presentation Logic) - What it looks like
        • Control Logic (Game Logic) - Rules of the game
    • Mixing styles -- Vanilla Javascript DOM Manipulation vs. JQuery DOM Manipulation
    • Overloading Functions
      • Accepts too many parameters (3 or fewer is best!)
      • Does too many things (could be broken down further)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.