Note that there are some explanatory texts on larger screens.

plurals
  1. POCoding Style Guide for node.js apps?
    text
    copied!<p>Is there a (or several) coding style guide for node.js? If not, what are the <strong>emerging styles</strong> used by the top open-source node projects?</p> <p>I'm looking for a guide (or several guides) along the lines of <a href="http://www.python.org/dev/peps/pep-0008/" rel="noreferrer">PEP 8</a>, the canonical Coding Style Guide for Python. I've seen various JavaScript guides not worth linking here (mostly old and targeted at client-side JavaScript). I found one interesting node.js <a href="http://nodeguide.com/style.html" rel="noreferrer">style guide</a>.</p> <p>A coding style guide, or coding conventions, should include (but is not limited to):</p> <ul> <li>Code layout: indentation (2 spaces, 4 spaces, tabs, ...), newlines, line breaks, etc.</li> <li>Whitespace, e.g., "function (arg)" vs. "function(arg)"</li> <li>Semicolon or no semicolon, var declaration, ...</li> <li>Naming, e.g., do_this() vs. doThis(), var_name vs. varName, ... </li> <li>node.js and JavaScript idioms, e.g., == vs. ===, callback's first arg is an error object, ...</li> <li>Comments and documentation</li> <li>Accompanying tools, like lint checker, unit test framework, ...</li> </ul> <p>This topic obviously is highly subjective, but I think it's an important step of a community to establish a common and widely accepted coding style in the process of getting mature. Also, it's not all just about taste. In particular, rules like "use === instead of ==" have a direct influence on code quality.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload