Is there a name for this idiom?

L

Lyle Johnson

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?
 
J

James Edward Gray II

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 Gray II
 
J

John Joyce

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 Gray II
How about "Am I me?" or "Worthless file name?"
 
B

Brad Ediger

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top