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

Home » Public Forums » archive » Re: Discussion on global variables in IDL
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: Discussion on global variables in IDL [message #26018] Wed, 01 August 2001 10:57 Go to previous message
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
I think Martin went more into the programming details here, giving
useful development ideas. What I would like to address, is the *purpose*
of IDL sessions.
You can either use IDL for ad-hoc testing of ideas (and this is what it
looks to me Dmitry is doing, from the "write two lines, debug, and write
next two"). Or you can write an *application* that will process the data
you need. In the latter case, if it turns out the user needs "global"
variables, it means that the application is not encompassing enough
within the IDL session. It means that an *application* is trying to
access ad-hoc data. If you write a program in IDL, think about it as if
it is to become a standalone program: how do you pass "global" data to
Photoshop, for example? And what is "global" data in this case?
If you do need a widget program to aid in the ad-hoc work, pass in the
"global" data via parameters or keywords.
Of course there are special cases, for instance data aquisition systems.
But if you are at that level and still remember about common blocks, you
are risking a dishonorable discharge from the EPA :-)
Common blocks are useful - there is little doubt about it. But I can see
very, very few instances when they are the only way. And the entire idea
of "global" variables seems to me to be resulting from the evolutionary
approach to programming - start with command line data analyses, get
tired of copy-paste. write code, expand it and still need to access the
data the way you started it.
Cheers,
Pavel
P.S. Of course, all the above is pure speculation. But I learned the
hard way that, no matter how tempting it is to just sit and write IDL
code as you think, it pays to design your data organization first, and
design the ways it is to be processed. Even more so when trying to write
useful object programs.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: testing. ignore. thank you.
Next Topic: Re: histogram question

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

Current Time: Sun Oct 12 12:23:37 PDT 2025

Total time taken to generate the page: 2.16144 seconds