-
Notifications
You must be signed in to change notification settings - Fork 29
Code standard
PotHix edited this page Jan 15, 2012
·
4 revisions
This page was made to help new contributors on how to write code for Akihabara. We are using simple patterns:
- Indenting with tabs.
- Always finishing the sentence with a semicolon.
- If possible choose to use brackets to surround your sentences to improve readability.
- Use JShint to help with the code quality. An example configuration: https://github.com/PotHix/pothix-config-files/blob/master/.jshintrc
Tipos from http://people.mozilla.com/~dmandelin/KnowYourEngines_Velocity2011.pdf
- Always use for(var i=0; len=myArray.length; i++){} instead of for(i in myArray){} (because the second version is 20-80x slower )
- Do not use throw/catch on the main loop