# Is there a name for this idiom?

**URL:** <https://www.ruby-forum.com/t/is-there-a-name-for-this-idiom/108777>\
**Category:** Ruby\
**Created:** [July 6, 2007, 10:21pm UTC](https://www.ruby-forum.com/t/is-there-a-name-for-this-idiom/108777 "2007-07-06T22:21:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lyle\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/45deac/32.png) [@Lyle\_J](https://www.ruby-forum.com/u/Lyle_J)\
**Post date:** [July 6, 2007, 10:21pm UTC](https://www.ruby-forum.com/t/is-there-a-name-for-this-idiom/108777/1 "2007-07-06T22:21:37Z")

</div>

When you want to move your program’s startup code into a block like so:

if **FILE** == $0  
# initialize and run program here  
end

What’s that called? Is there a commonly used name for that “startup”  
block?

---

<div class="post-metadata">

**Author:** ![Lyle\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/45deac/32.png) [@Lyle\_J](https://www.ruby-forum.com/u/Lyle_J)\
**Post date:** [July 6, 2007, 10:24pm UTC](https://www.ruby-forum.com/t/is-there-a-name-for-this-idiom/108777/2 "2007-07-06T22:24:37Z")

</div>

On Jul 6, 2007, at 3:20 PM, Lyle J. wrote:

> When you want to move your program’s startup code into a block like  
> so:
> 
> if **FILE** == $0  
> # initialize and run program here  
> end
> 
> What’s that called? Is there a commonly used name for that  
> “startup” block?

I have referred to such a block of code as the “application code”  
more than once, but I don’t in anyway believe that’s a standard name  
for it.

James Edward G. II

---

<div class="post-metadata">

**Author:** ![Lyle\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/45deac/32.png) [@Lyle\_J](https://www.ruby-forum.com/u/Lyle_J)\
**Post date:** [July 6, 2007, 10:38pm UTC](https://www.ruby-forum.com/t/is-there-a-name-for-this-idiom/108777/3 "2007-07-06T22:38:39Z")

</div>

On Jul 6, 2007, at 3:23 PM, James Edward G. II wrote:

> > “startup” block?
> 
> I have referred to such a block of code as the “application code”  
> more than once, but I don’t in anyway believe that’s a standard  
> name for it.
> 
> James Edward G. II

How about “Am I me?” or “Worthless file name?”

---

<div class="post-metadata">

**Author:** ![Lyle\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/45deac/32.png) [@Lyle\_J](https://www.ruby-forum.com/u/Lyle_J)\
**Post date:** [July 6, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/is-there-a-name-for-this-idiom/108777/4 "2007-07-06T23:09:42Z")

</div>

On Jul 6, 2007, at 3:23 PM, James Edward G. II wrote:

> > block?
> 
> I have referred to such a block of code as the “application code” more  
> than once, but I don’t in anyway believe that’s a standard name for  
> it.

Of course, that matches up with TextMate’s tab trigger for that code:  
app [tab].

Not as if you wrote the book on that or anything. 🙂

Brad
