Skip to content

Instantly share code, notes, and snippets.

@ingshtrom
Last active August 29, 2015 14:05
Show Gist options
  • Save ingshtrom/1558ef33b797b69eaf71 to your computer and use it in GitHub Desktop.
Save ingshtrom/1558ef33b797b69eaf71 to your computer and use it in GitHub Desktop.
Project structure guidelines that I think I want to follow for my projects.

Project Guidelines

Starting with mystic-noggin, I want to start keeping track of my project guidelines so that I can keep my projects consistent!...maybe.

Node.js

  • main 3 directories
    • pub: contains all generated files (usually from Grunt)
    • src: all source code. Within there are 'client' and 'server sections
    • test: all the tests for the src/ code

General

  • try to comment as much as possible, but don't comment on the obvious
  • keep it readable
// bad
var i=0;

//good
var i = 0;

Languages

Javascript

  • 2 space indentation, spaces only
  • no space after function name declaration and (
  • hoist variable declarations whenever possible
  • { on same line, } on newline
    • exception is for small statements like:
...
if (x) { return obj; }
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment