Re: Declaring a Function Before it is used
- Posted by Irv Mullins <irvm at ellijay.com> Oct 30, 2003
- 404 views
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