[REBOL] Re: Destroy no more useful functions
From: sunandadh:aol at: 17-Apr-2002 10:55
> Interesting. This is what I was thinking that recycle might do. I am
> beginning to see more all the time that using objects can be very useful.
I didn't invent the idea of using an object to encapsulate functions -- I got
it from someone on this list. And, truth-be-told, it would still be better if
the mythical Rebol 3.0 implemented a proper module-model.
But funcs-in-obs is a useful way to package an application. I tend to be
writing largish applications (6,000-12,000 lines of code, with a couple of
hundred functions). I tend to use this sort of template for where to put a
appl-main.r -- the main guts of the application
appl-init.r -- start-up, user-identification etc
appl-rec.r -- error recovery and reporting
appl-serv -- service functions (application-specific subroutines)
appl-panels -- Vid panels
appl-dd -- data definitions (data objects)
appl-io -- (read/write/decrypt etc for most files)
And then I have a few modules that are cross-application:
debug.r -- useful debugging tools
gui-utils -- VID functions (eg slider style)
std-utils -- other useful functions (eg soundex, csv-->object etc)
patches.r -- fixes to Rebol functions
Deciding where to put a function is half the struggle in deciding if I need
it at all.