Is wrapping new within the constructor good or bad?
<p>I watched John Resig's <a href="http://ejohn.org/blog/building-a-javascript-library/" rel="nofollow">Best Practices in JavaScript Library Design</a> presentation; one slide suggested "tweaking" the object constructor so it instantiates itself. </p>

<pre><code>function jQuery(str, con) {
    if (window === this) {
        return new jQuery(str, con);
    }
    // ...
}
</code></pre>

<p>With that, <code>new jQuery("#foo")</code> becomes <code>jQuery("#foo")</code>.</p>

<p>I thought it was rather interesting, but I haven't written a constructor like that in my own code.</p>

<p>A little later I read a post here on SO. (Sorry, I don't remember which or I'd supply a link. I will update the question if I can find it again.) One of the comments said it was bad practice to hide <code>new</code> from the programmer like that, but didn't go into details.</p>

<p>My question is, it the above generally considered good, bad, or indifferent, and why?</p>
