Skip to content

Instantly share code, notes, and snippets.

@vicapow
Last active December 18, 2015 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vicapow/5841813 to your computer and use it in GitHub Desktop.
Save vicapow/5841813 to your computer and use it in GitHub Desktop.

code review

  • don't forgot closing and opening <html> and <body> tags.
  • keep proper indentation of html and js code.

bad

<body>
<div id="frame" style="width:600px">
<p style="text-align: center;"> a-value slider</p><div id="aslider">
    </div>
      </div></body>

good

<body>
  <div id="frame" style="width:600px">
    <p style="text-align: center;"> a-value slider </p>
    <div id="aslider"></div>
  </div>
</body>
  • Avoid needlessly defining your variables globally

bad

  xdomain = [-6,6];
  p = .8;
  a = .4;
  binCount = 50;
  rec = null;

good

  var xdomain = [-6,6];
  var p = .8;
  var a = .4;
  var binCount = 50;
  var rec = null;
  • don't create new files for different versions. use git to create a branch if you want to work on two variations of the same file. If all you want is to keep the old version just in case, git is already doing this every time you commit. If you want to name a particular commit to easily refer to it later, use tags. you probably dont know what I'm talking about so google it or ask me later.

  • your use of commas is inconsistent. either always use them, or never use them. If you pick the latter, know when they're not optional

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment