Are too many self-invoking funtions in javascript a bad thing?
<p>Is it bad to have too many self-invoking funtions in javascript?</p>

<p>If they all execute right away (page load) aren't you taking more resources than if you had regular functions and call them when you need them? </p>

<p>Or is that a bug that exists in my head?</p>

<p>For example:</p>

<p>Thousands of these:</p>

<pre><code>var DoIT = (function () {
//heavy stuff
} ()); 
</code></pre>

<p>VS. Thousands of these:</p>

<pre><code>var DoIT = function () {
//heavy stuff
}; 
</code></pre>

<p>EDIT #1:</p>

<p>I'm talking about things like </p>

<ul>
<li>setting alerts</li>
<li>creating a jquery dialog with a large form</li>
<li>re-sizing things when they need to be resized.</li>
</ul>
