-
Notifications
You must be signed in to change notification settings - Fork 0
JavaScript Style Guide
80-character width lines. Newline at the end of each file. Use 2 spaces to indent.
Brace formatting should be on the next line for a named function and on the same line for a closure.
Use /* comment */ for multi-line comments. Use // otherwise.
Comment methods of an object in Javascript above declaration.
function do_thing()
{
return function(arg){
attack(x);
}
}When working with callbacks, put the brace on the same line as the paren:
function set_callback(obj)
{
obj.onComplete(function(data){
send(data);
});
}Never use ==, always use ===.
Only use single-letter variable names x, y, and z for
things you expect to be numbers.
If you have to write something nasty (it's Javascript, it happens), write a little apology and explination. If it's really gross, and you can prove that it's the best way to do it, we'll buy you a beer (or Soda of your choice).
Style Guides
Features
- Frontpage
- About pages
- Help pages
- Uploading Images
- Image pages
- Image comments
- Image search
- Image tagging
- Image collections
- Curating collections
- Creators
- Commissions
- Image of the Day
- Favorites
- User profiles
- User settings
- Error messages
- Reporting
- Admin console
- API
- Notifications
Mockups
Roadmap
Notes