Re: Naive pointer question ? [message #29005 is a reply to message #28944] |
Thu, 24 January 2002 07:30   |
David Burridge
Messages: 33 Registered: January 1998
|
Member |
|
|
Hi Paul et al.
> <BIG snip>
> p.s. Common blocks are not evil. They are unfairly maligned (and
misaligned) but should be used
> judiciously.... just like GOTOs.
Sorry, I couldn't resist this!!! The problem with common blocks two-fold,
both relating to their global scope (ie: the reason for using them in the
first place). First, if you have two programs running in an IDL session
(e.g. a pair of widget programs) which both use the same common block, each
will corrupt the others data. In fact, you might even just be using two
routines that don't realise another is accessing the common block. Secondly,
you cannot trace the changes in a common block, so debugging becomes a
nightmare. This is even worse in IDL when variables can change TYPE as well
as value.
That's it. Rant over:-) Let's just say, I gave them up a LONG time ago!-)
Cheers,
Dave
|
|
|