[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Duplicate module names. Was: Object epiphany: ...
> You *must*
> pick good, unique names for routines you hope people will use. The
> shadow scanning utilities in IDLWAVE are an excellent way to explore
> this issue (IDLWAVE->Routine Info->Routine Shadows). Here are some
> examples of overlaps:
>
> datatype()
> - JHU [C--] ~/idl/jhu/datatype.pro
> - NasaLib [C--] ~/idl/nasa/pro/misc/datatype.pro
>
> So, both NASA and John's Hopkins libraries define datatype(). They both
> do the same thing -- return the data type of a passed variable, with a
> variety of possible formats.
I've recently added a primitive FAQ to the IDL Astronomy Library
(http://idlastro.gsfc.nasa.gov/idlfaq.html ), and in question A8 I try to
address the namespace conflicts with programs in other libraries that I know
about. Unfortunately, once a name conflict exists, there is no easy
solution to fix the problem, unless one of the procedures has much wider
usage than the other one. But documenting the name conflicts can at
least make it quicker to diagnose any problems.
I know that some users of the Astronomy Library will append an IAL_ to the
start of every procedure to make sure they have no namespace conflicts.
But I share with JD a preference for descriptive names without prefixes.
(Thankfully, the DOS 8 character limits are ancient history). This does
require the additional effort of trying to be aware of the names already in
use in the major libraries.
Even more than "calculate.pro", my favorite uninformative (yet popular)
procedure name is "convert.pro". ..
--Wayne
Landsman
landsman@mpb.gsfc.nasa.gov
P.S. The IDL Astronomy Library will be unavailable much of April 20-23 and
April 27-30 due to planned power blackouts in our building.