Skip to content

Instantly share code, notes, and snippets.

@amcdnl
Created September 20, 2012 20:56
Show Gist options
  • Save amcdnl/3758318 to your computer and use it in GitHub Desktop.
Save amcdnl/3758318 to your computer and use it in GitHub Desktop.
Naming Conventions and Organization for JavaScript

Naming Conventions and Organization for JavaScript

Naming Conventions

Below are basic naming conventions for namespaces versus constructors in JavaScript.

Namespaces are lowercased. For example:

mycompany.viewer

would all be lower case. Constructors are uppercased. For example:

mycompany.viewer.App

If you were to add a sub-control to the viewer's hierarchy, it would look like:

mycompany.viewer.Search

rather than extend the mycompany.viewer.App namespace.

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