Re: Function names (was mean and sdev) [message #11053 is a reply to message #11050] |
Wed, 04 March 1998 00:00   |
Martin Schultz
Messages: 515 Registered: August 1997
|
Senior Member |
|
|
Brian Jackel wrote:
>
> Dr. G. Scott Lett wrote:
>>
>> The MOMENT function is obscure and slow when all you need is
>> the mean and standard deviation, so we're adding the more obvious
>> MEAN, STDDEV, VARIANCE and other statistics functions for IDL 5.1.
>>
>> Best wishes,
>> Scott Lett
>
> I'm not sure who the "we" above refers to, but I'd like to
> make a general comment. IMHO IDL is already dangerously
> cluttered with lots of special purpose functions that could
> perhaps be more usefully bundled together. In the case of
> statistics it would be better to have a function like MOMENTS
> that could return any or all required moments. Even better
> would be something (perhaps called STATISTICS) that could
> provide a number of useful quantities. Although the use
> of square brackets should eliminate the confusion between
> functions and arrays, the proliferation of built-in functions
> (especially with common names) may cause problems if the
> name has been used for existing code.
>
> Does anyone else have an opinion on this subject?
>
> --
> Brian Jackel
Oh yes, I do! In my opinion it gives much more readable code if you
can call a function named MEAN or STDDEV to get these values. On
the other hand, I see your point that there are far too many functions
in IDL that nobody can remember. But bundling always raises issues
of maintenance and completeness. My suggestion would be to think of
a number of "wrapper" routines (like your suggestion for statistics)
which can then take keyword parameters like /MEAN, /STDDEV, etc.
and which would call the appropriate internal IDL functions. But those
would not necessarily have to be developped by the IDL people ;-)
What I find much more bothering are inconsistencies within "families" of
functions, e.g. different ordering of parameters or naming of keywords
in say a linear fit and a polyfit function (of course, I cannot find a
suitable example right now, but I come across these things once a
while).
Just one additional word: the capability of finding the appropriate
IDL function depends strongly on the quality of the links in the online
help. After I had complained about a missing link to IDL once, they
replied and said they would be grateful for specific suggestions to
improve these links. At least there is some hierachical sorting in the
Navigate-Search Index menu - this could probably be improved (e.g.
"curve fitting" -- but why not "fitting" ?; how about an option to
search only the "topic" indices ?)
regards,
Martin.
------------------------------------------------------------ -------
Dr. Martin Schultz
Department for Earth&Planetary Sciences, Harvard University
186 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA
phone: (617)-496-8318
fax : (617)-495-4551
e-mail: mgs@io.harvard.edu
IDL-homepage: http://www-as.harvard.edu/people/staff/mgs/idl/
------------------------------------------------------------ -------
|
|
|