Re: Declaring a Function Before it is used

new topic     » goto parent     » topic index » view thread      » older message » newer message

Irv Mullins wrote:
> I understand the desirability of declaring a routine before referencing 
> it. But why couldn't something like:
> 
>  declare function foo(2) 
>  or
>  declare function foo ( name, age )
> 
> be used to declare a routine in advance? Seems that meets the 
> philosophical requirements as well as the practical ones.

In practice, people would simply arrange their 
routines in random order, then keep adding 
declarations until the interpreter shuts up.

I like having some kind of logical order imposed,
and machine verified. You may have an even more
logical way of arranging some of your routines,
but what does it mean to me as the reader of your 
code? And is it machine verified?

I still think the advantages of 
"define-it-before-you-use-it" outweigh
the nuisance of occasionally having to copy/paste
a routine to a new place. It may not be desirable 
in *every* program, but when people know there are 
no exceptions to this rule, it promotes the 
readability and maintainability of Euphoria 
programs in general.

Regards,
    Rob Craig
    Rapid Deployment Software
    http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu