Re: Function names (was mean and sdev) [message #11065 is a reply to message #11050] |
Tue, 03 March 1998 00:00  |
J.D. Smith
Messages: 214 Registered: August 1996
|
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
I agree wholeheartedly. It seems to me that making multipurpose
routines fast was the reason (among others) for introducing the function
arg_present. One can use it to make a version of MOMENT for instance,
that only calculates variance, skew and kurtosis if the user wants
them. I think in general a balance has to be struck between ease of use
and over-cluttering. In this case, since mean and stdev are likely the
most common calculations performed, they may merit their own functions,
but I do agree that restraint is in order (or a more robust shadowing
mechanism... but I won't hold my breath).
JD
--
J.D. Smith |*| WORK: (607) 255-5842
Cornell University Dept. of Astronomy |*| (607) 255-4083
206 Space Sciences Bldg. |*| FAX: (607) 255-5875
Ithaca, NY 14853 |*|
|
|
|