Timestamp: I had replied to Jack's posting (to which Sven is
replying) before I read this one of Sven's. Now I'm trying to
catch up.
On Fri, 31 Jul 2009, Sven Schreiber wrote:
Riccardo (Jack) Lucchetti schrieb:
> I'd like to voice my opinion on a few things:
>
> 1) there are a few cases when a certain function may conceivably behave
> in either of two ways: sort up/down, reverse rows/cols etcetera. In all
> these cases, having a policy might be nice (although it could also be a
> little bureaucratic, but still). Possible policies are:
>
> a) two functions (sort()/dsort())
> b) one function with optional boolean switch (sort(a)/sort(a,1))
> c) one function with some userland tricks (sort(a)/-sort(-a))
>
> My personal ordering (best to worst) is b-c-a, but I'm open to change my
> mind. I'd like to make one exception, though: I like ok() and missing(),
> I use them both and scrapping one of the two would imply me having to go
> over quite a few scripts. Besides, something like ok(x, 1) yielding 1 if
> the corresponding observation is missing strikes me as bizarre to say
> the least.
Jack, this really sounds like your stated preference b-c-a and your
revealed preferences are not consistent...
Hmm, not sure that's fair. Jack grants one exception to his
preference of b over a, namely the ok/missing thing on which we
all seem to be agreed.
However, we do have a fair number of "paired" functions,
particularly relating to matrices: imaxc/imaxr, iminc/iminr,
maxc/maxr, meanc/meanr, minc/minr, selifc/selifr, sumc/sumr. I
doubt that Jack intends that we scrap these: having to transpose
every time would be a bother to the user, and inefficient to boot.
Does this argue for rreverse/creverse in place of mreverse?
Perhaps, but one might argue that a less-used function can stand
to have a little overhead (i.e. the existing boolean switch) to
avoid cluttering the namespace. I'd say it's a marginal case that
doesn't matter much either way.
Plus, how would one rename, say, minc/minr, in a comprehensible
fashion if one were combining the two functions? "mmin" doesn't
speak to me like "minr" or "minc".
"Consistency" can be assessed at various levels of sophistication,
and something that appears inconsistent at level k may appear
consistent at level k + 1.
I'll have to think a bit more about pergm before responding on
that.
Allin.