Super, that's what I was hoping. I just wasn't sure how much overhead is
incurred calling many functions in various browsers. In other dynamic
languages (Ruby, Python, etc.) there's a pretty steep penalty paid on
symbol lookup, so in situations where optimization is important many
developers shy away from decomposing a lot.




On Sat, May 3, 2014 at 11:50 AM, Raymond May Jr.
<notifications@github.com>wrote:

> In public/WBLogger.js:
>
> > +    var self = this;
> > +
> > +    // assert(self.constructor !== WBLogger, 'can\'t initialize WBLogger');
> > +    assert.string(namespace, 'WBLogger namespace must be a string');
> > +
> > +    var namespaceMap = WBLogger.namespaces;
> > +
> > +    // if the namespaced logger already exists, use it
> > +    if (namespaceMap[namespace] instanceof WBLogger) {
> > +      return namespaceMap[namespace];
> > +    }
> > +
> > +    // save the namespace
> > +    self.namespace = namespace;
> > +
> > +    // cache the instance
>
> JS is all about tiny functions. Large functions do not optimize well in
> engines. We enforce a very low function size on all the new modules
> wb.core, db, sync and sdk through static analysis. Usually, our comments
> hopefully aren't a smell.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/wunderlist/wunderbits.core/pull/35/files#r12255755>
> .
>



--