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

Home » Public Forums » archive » Re: Ranting and Raving and getting back to global variables
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: Ranting and Raving and getting back to global variables [message #11560 is a reply to message #11554] Mon, 20 April 1998 00:00 Go to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
David Fanning (davidf@dfanning.com) wrote in a reply to J.D. Smith
(jdsmith@astrosun.tn.cornell.edu) who, in another elegant
and well-reasoned article, this time on main-level variables,
ends the article by writing this:
>
[...]
>
>
> Having spent considerable time afield (and I say this with
> considerable humility and respect for the efforts of people
> trying to learn IDL), I believe that more often RSI errs
> on the side of *overestimating* the user's ability to harness
> and control the power of IDL.
True enough: I still remember my first months' struggle trying to
convince myself that the effort of learning IDL may pay off one day. I
strongly agree with David's suggestion that the IDL folks should
make an effort to consolidate the powerful system they provide before it
may one day become totally incomprehensible (just imagine David would
retire one day ! ;-)

Coming back to the point of global variables etc.: I still can't fully
understand the need to create main variables in a subroutine. My
philosophy (may be a bit antique ?) is that you should know what to
expect from a subroutine when you are calling it, hence you can pass it
a parameter which would in your example return the image that you loaded
and manipulated (if you don't like to restrict yourself to an image, you
can pass a structure and stuff it with everything you like). So what is
the point of typing (at a minimum two !) additional characters to a call
like

my_fancy_widget_routine_that_does_everything_anybody_has_eve r_dreamed_of

(simply add ,a and you can get back to the main level any kind of
data, images, etc. you like).

E.g in my case; I am very often working with 2D data sets that have an
additional variable_names array associated with them. So almost all of
my subroutines can be called as
routine,data,header
or sometimes
routine,data=data,header=header
and I don't even have to think about this any more when I type it. So
why should I bother and call
routine
bring_to_main_level,data,header
(or something alike) ?


Should I sign with Joe Farmer now?
Best regards,
Martin


------------------------------------------------------------ -------
Dr. Martin Schultz
Department for Earth&Planetary Sciences, Harvard University
186 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA

phone: (617)-496-8318
fax : (617)-495-4551

e-mail: mgs@io.harvard.edu
IDL-homepage: http://www-as.harvard.edu/people/staff/mgs/idl/
------------------------------------------------------------ -------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Global variables and command line
Next Topic: Procedure shade_surf

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

Current Time: Sat Oct 11 03:55:25 PDT 2025

Total time taken to generate the page: 1.11972 seconds