[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Object epiphany: A new way of building widget applications

"JD Smith" <jdsmith@astro.cornell.edu> wrote in message
> Martin Schultz wrote:
> >
> >    With almost a week delay, I finally get around to release the first
> > version of a new class of IDL objects: the MGS_GUIObject hierarchy.
> I think it only fair to let people know that I tend to shy away from
> distributed code with people's initials in the name.  I know, it sounds
> stupid, but I'm not sure I'm the only one.  It seems to be a reasonably
> common practice here (Craig, you listening?), but one which I think
> might be best to avoid, for the following reasons:

As one of the pioneers of this trend (he says modestly) may I present the
opposing viewpoint:

It's namespace management, pure and simple. It's desirable because IDL lacks
built-in facilities.

> 1.  It conveys a sense of ownership or heavy expectations that are
> perhaps unjustified, and not intended.  (Can I *change* such a routine,
> should I feel guilty, etc...).

Well, it's not *meant* to convey this.

> 2.  It takes up space in a name which could perfectly well have been
> used for more descriptive characters.

Unfortunate, but true.

> 3.  If the routine/class/function/widget name following, e.g., JDS, is
> so ambiguous as to require the initials to discriminate it from another
> of the same name, either the routine/class/function/widget isn't that
> useful, or its name is entirely too inspecific.

Didn't you have a "queue" & a "stack" class on your WWW page? Well. someone
did. I have written a stack class too. I call it "mgh_stack". It's a fairly
inspecific class, so I give it a suitably inspecific name and add my
initials on the front. What should I call it,
"this_is_a_different_stack_from_jds_one"? Or

> And the way I think
> about it, since IDL doesn't do any shadow checking (but cf. idlwave!),
> the *best* routine with a given generic name will rise to the top.

The one that rises to the top is somewhat unpredictable. (Well, strictly
speaking it's predictable because yuu can control your PATH, though I have
noticed recently that Windows 2000 expands path entries preceded by + in
*reverse* alphabetical order, which caused me some grief.) The thing is, I
don't remember exactly what is where on my PATH and I don't like relying on
the search order. I have been bitten by duplicated routine names a number of
times: CALDAT and CREATE_STRUCT are two I can remember.

> 4.  The author(s) can always be found in a proper documentation header.

Sure, but it's not about claiming ownership, it's about namespace

But hey, there's room for all points of view. If you don't prepend your
initials and I do, then our routine names will never clash.

Is there any other MGH out there?
Mark Hadfield
m.hadfield@niwa.cri.nz  http://katipo.niwa.cri.nz/~hadfield
National Institute for Water and Atmospheric Research