A way around that is

var logger = new (require('logger'));

But that's ugly and, as I found out, jscoverage will strip the parenthesis 
and break the code.
It's really, IMO, about consistency, if you export constructors in half the 
modules and factories in others that's not going to help. Isaac's approach 
is nice as long as developers follow it with their modules.

On Sunday, March 24, 2013 11:47:29 AM UTC-4, Scott González wrote:
>
> On Sat, Mar 23, 2013 at 8:22 PM, Rick Waldron 
> <[email protected]<javascript:>
> > wrote:
>
>> On Fri, Mar 22, 2013 at 1:50 AM, Nabeel S. <[email protected]<javascript:>
>> > wrote:
>>
>>>
>>>    var logger = bunyan.createLogger(...);
>>>
>>
>> Why do module authors make gross factory APIs?
>>
>
> Module authors are likely just following core conventions. The reason node 
> originally used these factories was a limitation in the C++ 
> code<https://groups.google.com/d/msg/nodejs/GTaCdFPlweI/M0q38C3SJpkJ>. 
> However, 
> Isaac has also explained why he prefers not requiring the use of the new 
> keyword<https://groups.google.com/forum/#!msg/nodejs/JI6CUkFksog/CEOMceoQuxQJ>
> .
>
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to