Skip to content

Instantly share code, notes, and snippets.

@indexzero
Created January 29, 2011 23:01
Show Gist options
  • Save indexzero/802294 to your computer and use it in GitHub Desktop.
Save indexzero/802294 to your computer and use it in GitHub Desktop.
Naming conventions in Javascript that I use personally
//
// PascalCase for ConstructorFunctions
// Found in: (constructor-function.js)
//
var ConstructorFunction = exports.ConstructorFunction = function () {
// Do Stuff here
};
//
// camelCase for methodNames and variableNames
//
ConstructorFunction.prototype.someMethod = function () {
return null;
};
//
// Code Consistency: Use (JSLint)[https://github.com/as-jpolo/node-lint]
// Documentation: Use (JSDoc)[https://github.com/visionmedia/dox]
// Testing: Use (Vows)[http://vowsjs.org]
// Database: Use (Cradle for CouchDB)[http://github.com/cloudhead/cradle] or (Mongoose for MongoDB)[https://github.com/learnboost/mongoose]
//
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment