Firefox/Projects/TabCandy/Work: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 190: Line 190:
= Style Guide =  
= Style Guide =  


Use spaces, not tabs, with two spaces per "tab stop".  
* Use spaces, not tabs, with two spaces per "tab stop".  
 
* 80 character line length limit.
80 character line length limit.
* Prefer native methods over libraries where appropriate. For instance, use Array.forEach() rather than iQ.each() (note that for each(...in...) [https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Statements/for...in#Description has issues] and should generally be avoided).
 
* Assert text should be written in terms of what should happen rather than what did or did not happen, e.g. Utils.assert(a == 2, "a should be equal to 2"). This way it's clear both when reading the code and when reading the console/log.
Prefer native methods over libraries where appropriate. For instance, use Array.forEach() rather than iQ.each() (note that for each(...in...) [https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Statements/for...in#Description has issues] and should generally be avoided).
68

edits

Navigation menu