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

Home » Public Forums » archive » Re: FSC_PLOT defaults
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: FSC_PLOT defaults [message #74131 is a reply to message #74130] Tue, 21 December 2010 12:38 Go to previous messageGo to previous message
ben.bighair is currently offline  ben.bighair
Messages: 221
Registered: April 2007
Senior Member
On 12/21/10 1:53 PM, Marc Buie wrote:
> Ben writes:
>
>>> Also, it is awkward to use simultaneous instances of things that
>>> rely on (the same) global variables.
>>
>> I'm a little fuzzy on this. How might this occur?
>

Hi,

> This is a very serious issue, especially if you use any kind of
> widget programming (doesn't have to be object oriented stuff,
> either). With widgets you can have multiple copies of the same tool
> each looking at different data. You can also have different tools
> running at once. Each of these can run asynchronously and at any
> time. If you have a set of graphics tools that all depend on a
> global variable for its behavior (and perhaps modify it) then you are
> stuck with every tool taking on the same behavior. Sometimes that
> might be ok but mostly it's not what you want.

Hmm. I think every tool should take on the same default behavior, which
programmers override with keywords as they do now.

> For this reason, I never, ever use the global variables to control
> plots unless it's in a throwaway script. In a program, I always use
> the graphics keywords to set the behavior. There are ways to make
> the global variables work for you but you have to be _very_ careful.
> For me, the price is always too high.


Yes, I can see how that would be a serious issue if the user modified
the system variable. Even so, if the purpose is to define configurable
default values then presumably the defaults are, well, the defaults when
nothing else is specified. If one wanted something other than the
default one would do as you do... use the graphics keyword to explicitly
set the value.

The fatal flaw you point out is that the user will try to use the system
variable so define the graphic state for Graphics A and also try to use
the same variable to define the state for Graphics B which might be
different. I guess I hadn't thought of that. I was thinking of David
literally allowing the user to define fresh-session default values. If
the programmer changes the default value between the realizations of
Graphics A and Graphics B, well, then so be it. The default has been
redefined.

But won't most programmers follow your suit by explicitly stating the
graphics keywords?

Now that I stew on this, I am beginning to think I am more right than
wrong. The default for Graphics A and Graphics B should point to the
same defaults using David's FSC_* routines. They do now since David
defines background = "white" as the default. Using a system variable as
proposed, the default value for background isn't hardwired in the code
as it is now. That is the only change.

Man-o-man! He could even make two or three different default starter
kits available form his website:

"The Traditionalist Starter Kit"
Background = "Black"
Color = "White"

"The Fanning Starter Kit"
Background = "Ivory"
Color = "Charcoal"

"The Geezer Starter Kit"
Background = "Black"
Color = "White"
Charsize = 20

"The Holiday Starter Kit"
Background = "Green"
Color = "Red"


Maybe another potential flaw might arise when I write code for someone
else forgetting that the end-user may have different defaults than me.
Well, I guess that's another reason to explicitly set the value of
graphics keywords one code I'll be sharing with others.


Cheers,
Ben
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: updating the coyote library
Next Topic: Re: Hodograph plots of wind speed and direction

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

Current Time: Wed Oct 08 19:31:26 PDT 2025

Total time taken to generate the page: 0.00480 seconds