1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-24 11:32:27 +01:00

Revert removal of "new" usage recommendations in HACKING.

The entire code base follows this recommendation and removing it implicitly
contradicts the primary rule of matching the existing style.
This commit is contained in:
Doug Kearns
2009-10-15 23:59:49 +11:00
parent eefebdb05d
commit 5141995f97

11
HACKING
View File

@@ -110,7 +110,16 @@ is hard to read.
The exceptions to this rule are for objects with __iterator__ set,
and for XML objects (see README.E4X).
* Use [] and {} rather than new Array/new Object.
* Avoid using 'new' with constructors where possible, and use [] and
{} rather than new Array/new Object.
Right:
RegExp("^" + foo + "$")
Function(code)
new Date
Wrong:
new RegExp("^" + foo + "$")
new Function(code)
Date() // Right if you want a string-representation of the date
* Don't use abbreviations for public methods
Right: