From 5141995f97fc87cb4750329e25a403f8ebb89cf7 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Thu, 15 Oct 2009 23:59:49 +1100 Subject: [PATCH] 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. --- HACKING | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/HACKING b/HACKING index 190722d5..b2ee6c37 100644 --- a/HACKING +++ b/HACKING @@ -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: