[Joseph McDonald] > The following will not work in ruby because the method is defined > *after* ruby attempts to execute the method "hello": > > hello > def hello; puts "hello"; end > > My question is: are there any benefits to such behavior? Would it be > better if ruby parsed the entire file before beginning execution (like > perl does)? Is it possible or would it break a core ruby behavior? I think it would mean breaking with core Ruby philosophy. Ruby is not a declarative langauge. When it runs a file it executes each statement in turn. def-statements are just statements that create methods. When you think of a program like this, it becomes easy to understand what happens when you for example change the implementation of a method like this: def hello; puts "hello"; end hello alias :old_hello :hello def hello; old_hello; puts "world"; end hello I'm not sure how code like this should be handled in your model. Whatever you do, things will surely break. And I don't think the current model is much of a problem. If you want to have your statements at the start, just put them in a main method and call it at the end of the file def main; hello; end ... main // Niklas