comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Time to Fish or Cut Bait
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Time to Fish or Cut Bait [message #74711] Tue, 01 February 2011 11:55 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Folks,

OK, after writing for three days about how this new
Coyote Graphics System works, I find myself on the
horns of a dilemma. On the one hand, this whole
resizeable graphics thing is so nice, I'm probably
never going to use anything else. And there is likely
to be one or two others, whose sysadmin people are so
mean they will never upgrade to IDL 8, who will join me.

On the other hand, it is getting to be a real pain
to type "FSC_This" and "FSC_That". Very awkward.

I am *seriously* considering changing all "FSC_"
prefixes, on *all* my Coyote Graphics routines
to "cg" with no underscore. In other words:

FSC_Contour -> cgContour
FSC_Colorbar -> cgColorbar

I have to make a decision, because in about two days
it will be WAY too late for any of this.

I have thought about this, too. Leave them named
the way they are, but provide a package of
synonyms, maybe just a single program that you call
once in your startup file and now you can call these
programs using shorter names. This would give
everyone the ability to use whatever synonym their
fingers were happy to type. I haven't explored all
the ramifications of this, because some of these
routines have output keywords and I have to be sure
I can get these into and out of programs properly.

One problem I see with this solution is that I've just
commandeered two different name spaces.

Does anyone have any thoughts or ideas about this?

Maybe it's a moot point because I'm the only one
who is going to use the darn things, so I can call
them whatever I want to. But when I find myself writing
programs like this, which I just wrote about 10 minutes
ago, I figure there is a problem somewhere. :-(

PRO wsho, wid
FSC_WSet, wid
END

Thanks for your ideas.

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Time to Fish or Cut Bait [message #74794 is a reply to message #74711] Tue, 01 February 2011 19:02 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Kenneth P. Bowman writes:

> I don't know if this is what you are asking, but I think
> the owner tag should go at the *end* of the name.
>
> I just find it very hard to look at a list of names that
> all start with FSC_ and find the one I want. They all look
> the same to me.
>
> On the other hand, if the names are
>
> Contour_FSC
> Plot_FSC
> ...
>
> I find it to be much easier to scan. It's a perception/cognition
> thing. :-)

Humm. Probably a good idea. Comes at a good time
too, just after five hours of concentrated work
changing all the references in by book and Library,
and just as I was reaching for the Commit button. :-(

I think I'm going to leave it. I appreciate the idea,
but I think if your fingers are going to have to learn
a new pattern anyway, it's best to put the new pattern
at the *start* of the routines, rather than at the end.
Makes it a little more regular, it seems to me. And as I
stare at the list, I sort of like that they are all grouped
together in my project window. I know right where to find
them.

Pros and cons, I guess. But I don't feel like another five
hours of *that* kind of work. :-)

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Time to Fish or Cut Bait [message #74795 is a reply to message #74711] Tue, 01 February 2011 18:26 Go to previous messageGo to next message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <MPG.27b21326dceb4d9298998f@news.giganews.com>,
David Fanning <news@dfanning.com> wrote:

> I am *seriously* considering changing all "FSC_"
> prefixes, on *all* my Coyote Graphics routines
> to "cg" with no underscore. In other words:

I don't know if this is what you are asking, but I think
the owner tag should go at the *end* of the name.

I just find it very hard to look at a list of names that
all start with FSC_ and find the one I want. They all look
the same to me.

On the other hand, if the names are

Contour_FSC
Plot_FSC
...

I find it to be much easier to scan. It's a perception/cognition
thing. :-)

Cheers, Ken Bowman
Re: Time to Fish or Cut Bait [message #74802 is a reply to message #74711] Tue, 01 February 2011 15:16 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
SonicKenking writes:

> So, in short, I'd be happy if these routines can be kept and I can
> then be lazy without changing any of my existing code. The synonymous
> wrapper sounds a good idea to me.

Yeah, I know, I hear you. But, I've lived with regret.
I don't care much for it. :-(

I think I have to do this. If I can't teach *my* fingers
to type the darn commands, I can't expect to gather too
many converts to the one True Path. Got to make it easy
for them. Picnics on Sundays, that sort of thing. ;-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Time to Fish or Cut Bait [message #74803 is a reply to message #74711] Tue, 01 February 2011 15:16 Go to previous messageGo to next message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
On Tuesday, February 1, 2011 4:14:46 PM UTC-5, David Fanning wrote:

> (Wayne, I'll wait to hear from you before I pull the trigger
> on this entirely!) By my count that is 19 files whose names
> will change, but all written specifically for the book,
> and all mostly since November.

I have updated versions of the plotting routines in the Astron library (e.g. MULTIPLOT, PLOTERROR, PARTVELVEC, LEGEND, TVCIRCLE, LINEID_PLOT, IMCONTOUR) which now call the Coyote graphics routines. But I haven;t made these routines public, and it is easy enough to do a global replace, so the change is fine with me. --Wayne
Re: Time to Fish or Cut Bait [message #74805 is a reply to message #74711] Tue, 01 February 2011 14:16 Go to previous messageGo to next message
SonicKenking is currently offline  SonicKenking
Messages: 51
Registered: October 2010
Member
Hi David,

I have been using the FSC_xxx routines quite extensively in almost all
my plotting related programs. Especially, contour, plot, plots, color,
colorbar, erase, text, window, ps_xxx. I am sure that I have also used
other fsc_ procedures. But these are from the top of my head.

So, in short, I'd be happy if these routines can be kept and I can
then be lazy without changing any of my existing code. The synonymous
wrapper sounds a good idea to me. The users can just set whatever
they'd like. At one point, I even thought you could have a GUI program
to help users for the synonym setup.

Anyway I only speak for myself. You can and should do whatever seems
sensible to you. After all, I guess I can fix my programs with some
search and replace.
Re: Time to Fish or Cut Bait [message #74807 is a reply to message #74711] Tue, 01 February 2011 13:14 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul van Delst writes:

> This renaming I also think would be good.
> Mostly because amongst all the "FSC_" (or "cg")
> examples you've posted, "TVImage" stood out.

OK, here is what I think I am going to do. If you
don't like this let me know ASAP. And I mean, ASAP. :-)

There are three routines that are in every piece of
code I've written in the past 15 years:

TVImage
FSC_Colorbar (whose name was changed from Colorbar)
FSC_Color

What I am going to do is write wrappers for those three
routines, but leave the routines in the Library. I *will*
take advantage of the cgImage wrapper to re-think my
original interpolation decision, but I can still do all
my on-going development work on TVImage.

cgColorbar and cgColor will just be straightforward
wrappers.

All the other *graphics* routines that I wrote for the
book, I am going to rename with a "cg" preface instead
of a "FSC_" preface. I haven't written that many programs
using these routines, so I presume no one else has either.
(Wayne, I'll wait to hear from you before I pull the trigger
on this entirely!) By my count that is 19 files whose names
will change, but all written specifically for the book,
and all mostly since November.

Sheesh! I wish we ALL knew at the beginning of the journey
what we only know too well at the end! :-(

Still better to do this today, rather then regret it forever
next week.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Time to Fish or Cut Bait [message #74817 is a reply to message #74711] Thu, 03 February 2011 11:15 Go to previous message
Matt[2] is currently offline  Matt[2]
Messages: 69
Registered: March 2007
Member
On Feb 2, 9:21 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:

> I use a prefix (pp_) for code I create. I only use a suffix (_pp) in
> the very specific case of wrappers or edits I did to code written by
> others (as in histogram_pp), so that it is clear that it is only a
> small modification to something I did not write. Also, it keeps the
> modification next to the original code alphabetically.

I like this idea. I use a lot of mhs_ for my code, but haven't
postfixed for
minor tweaks.

Really I think the best thing would be if ITTVIS decided it wanted to
be a
modern language, then you could just use a namespace.


Matt
Re: Time to Fish or Cut Bait [message #74827 is a reply to message #74803] Thu, 03 February 2011 01:42 Go to previous message
Fabzou is currently offline  Fabzou
Messages: 76
Registered: November 2010
Member
Hi,

On 02/02/2011 12:16 AM, wlandsman wrote:
> I have updated versions of the plotting routines in the Astron library (e.g. MULTIPLOT, PLOTERROR, PARTVELVEC, LEGEND, TVCIRCLE, LINEID_PLOT, IMCONTOUR) which now call the Coyote graphics routines. But I haven;t made these routines public, and it is easy enough to do a global replace, so the change is fine with me. --Wayne


I would be interested in the "fsc_* version" of partvelvec. Do you plan
to make it public?

Thanks a lot!

Fabien
Re: Time to Fish or Cut Bait [message #74833 is a reply to message #74711] Wed, 02 February 2011 22:00 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Jeremy Bailin writes:

> What did FSC stand for anyways?

Exactly! :-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Time to Fish or Cut Bait [message #74835 is a reply to message #74711] Wed, 02 February 2011 20:21 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Feb 3, 1:29 am, Jeremy Bailin <astroco...@gmail.com> wrote:
> I can see the argument, but I think the dominant convention is that the namespace comes at the beginning (how many people regularly use mg_... routines? and I certainly have lots of jb... calls in my code, whether or not anyone else does!). So I think convention comes first in this case.
>
> As for FSC_ vs. cg, I don't think cg is really much better, but I also don't really mind the change. What did FSC stand for anyways?

I use a prefix (pp_) for code I create. I only use a suffix (_pp) in
the very specific case of wrappers or edits I did to code written by
others (as in histogram_pp), so that it is clear that it is only a
small modification to something I did not write. Also, it keeps the
modification next to the original code alphabetically.

Besides being the common practice, and keeping a library's files
together alphabetically, prefixes make more obvious a name hierarchy:
first comes the root level (the developer or library name), which may
contain subgroups (the category of routine), which contain individual
routines.

I have not yet put my code into categories (which in hindsight I find
would have been good in some projects), so there is only the prefix
and the routine name (as in pp_isnumber). ITTVIS uses categories after
their prefix (as in IDLffShape and IDLanROI).
Re: Time to Fish or Cut Bait [message #74838 is a reply to message #74795] Wed, 02 February 2011 19:29 Go to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
I can see the argument, but I think the dominant convention is that the namespace comes at the beginning (how many people regularly use mg_... routines? and I certainly have lots of jb... calls in my code, whether or not anyone else does!). So I think convention comes first in this case.

As for FSC_ vs. cg, I don't think cg is really much better, but I also don't really mind the change. What did FSC stand for anyways?

-Jeremy.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Envi_get_slice error (subscript range error)
Next Topic: automatically changing focus to x-window /command line

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:26:47 PDT 2025

Total time taken to generate the page: 0.00775 seconds