Re: library help -- multiple procedures in one file [message #30944 is a reply to message #30942] |
Fri, 24 May 2002 11:36   |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
Chris O'Dell <odell@cmb.physics.wisc.edu> writes:
> This question is mostly aimed at people who build libraries for public
> use (David, Craig, etc). I am putting together a lot of the little
> useful routines I have written as a grad student into a library, and was
> wondering, should I juse make EVERY procedure/function have its own
> file? In PASCAL, I was a big proponent of nested functions;
> functions/procedures really ONLY used by one other procedure or
> function. But in IDL, those functions aren't compiled on the fly and
> you have to open the darn function file and compile them all every time
> you start idlde. Is there any way around this?
Hi Chris--
I actually asked the newsgroup this very question about a year ago.
In fact it was related to the "SAVE" library that I published and
(unfortunately) has achieved some infamy.
I had a library with many many functions, each in a separate file, and
I wondered how to manage them all. I felt it would be unwieldy for
the user to have a bunch of files, especially for the routines that
were more or less "internal." I finally decided to restructure the
library so that most of the internal functions were subsumed into more
generalized procedures. Utility routines that were used by only one
procedure were moved into that procedure's file. For the most part I
think that was a good approach.
By the way I agree with David's suggestions. I am not sure David's
are totally compatibile with Liam's recommendations, for example I
would say that internal "utility" routines always belong in the main
command file, whereas Liam suggests each file has one procedure or
function.
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|