Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:client_coding:coding_guidelines [2014/04/23 17:02] – move comments to separate section dstillmandev:client_coding:coding_guidelines [2017/11/27 05:18] (current) – Remove Zotero 5 warning bwiernik
Line 38: Line 38:
 </code> </code>
  
-Braces must **always** be used, even if the enclosed block contains a single line.+Braces must **always** be used for multi-line conditionals, even if the enclosed block contains a single line.
  
 Bad: Bad:
Line 100: Line 100:
 ===== Comments ===== ===== Comments =====
  
-  * Functions should be commented using JSDoc syntax:+Functions should be commented using JSDoc syntax: 
 <code javascript> <code javascript>
 /** /**
  * Does something or other  * Does something or other
  *  *
- * @param {String} value - This is a value + * @param {string} value - This is a value 
- * @param {Boolean} [optionalValue] - This is an optional value + * @param {boolean} [optionalValue] - This is an optional value 
- * @return {Number[]} - Array of itemIDs+ * @return {number[]} - Array of itemIDs
  */  */
 function myFunction(value, optionalValue) { function myFunction(value, optionalValue) {
Line 113: Line 114:
 } }
 </code> </code>
-  * For readability and neatness, add a space after the slashes in line comments, and capitalize the first word:+ 
 + 
 +For readability and neatness, add a space after the slashes in line comments, and capitalize the first word: 
 Bad: Bad:
 <code javascript> <code javascript>
dev/client_coding/coding_guidelines.1398286951.txt.gz · Last modified: 2014/04/23 17:02 by dstillman