Re: Declaring a Function Before it is used

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

On Thursday 30 October 2003 06:30 am, you wrote:
>
>
> I'm with Derek on this one.  The lack of forward referencing really
> starts to hurt when you are writing/maintaining large libraries (like
> EuGrid in my case).

Agreed. Recently I've been trying to write some database programs 
in a neat, modular way, and the lack of forward declarations means 
a lot of "routine juggling" (moving routines from an include file where 
they _logically_ belong to some other include where they don't, but 
where they are able to see the routines they depend upon).

> I don't see the value in an imposed 'philosophy' which just ends up
> wasting my time.

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.
As someone pointed out earlier, there's no point in putting 
types in the parameter list, as no type checking is done until 
run-time, but it might be nice to be able to give meaningful 
or descriptive names to the parameters. 
Rob?

Irv

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

Search



Quick Links

User menu

Not signed in.

Misc Menu