RE: Declaring a Function Before it is used
- Posted by Phil Russell <pg_russell at lineone.net> Oct 30, 2003
- 473 views
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). I don't see the value in an imposed 'philosophy' which just ends up wasting my time. I don't know much about the interpreter's innards but perhaps a compromise would be a new 'with forward references' declaration statement? If this were possible then those of us who don't mind a slight potential performance penalty could write code the way *we* want to. The rest could carry on as at present. Regards, Phil Derek Parnell wrote: > > > ----- Original Message ----- > From: "Ricardo Forno" <rmforno at tutopia.com> > To: <EUforum at topica.com> > Sent: Wednesday, October 29, 2003 4:22 PM > Subject: RE: Declaring a Function Before it is used > > > > If your program really needs that, then it is not so simple. In fact, > > this > > is necessary only when you have two (or more) mutually recursive > > functions. > > Regards. > > The other time it is 'necessary' is when the coder wishes to have the > source code structured in such a manner that it reflects the > architecture of the application. That's a fancy way of saying the I'd > like to have related routines physically close to each other in the > source code. > > With the current restriction in Euphoria, I am frequently moving > routines around the source files so that they can used - this is one of > the reasns why Win32lib is such a dog's breakfast. For example, I > sometimes will change a routine so that it now calls another routine, > only to find that the routine I'm now calling is further down the in the > source file. So I must rearrange the code to accommodate RDS's > philosophy. And in doing so, I might suddenly find that I need to more > more than one (often unrelated) routine to get it 'just right'. In fact, > I've gotten so sick and tired of doing this that now I resort to > routine_id() calls instead of rearranging source code. Call me lazy, but > it is not effective coding practice (IMNSHO) to continually be concerned > with juggling the physical layout of source code. > > The other language I deal with in a daily manner is Visual Basic, and > that language does not require either pre-declaration or restricted > physical code layouts. I can group my routines in a logical manner and > not worry about where in the source code a routine is physically coded > in order for me to use it. > > RDS is got this one wrong. > > -- > Derek > >