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

Home » Public Forums » archive » Re: variables in common blocks
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: variables in common blocks [message #53873 is a reply to message #53871] Fri, 04 May 2007 08:16 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Lasse Clausen writes:

> Ok. I'll describe what I am using common blocks for: Whatever day
> during the week, I am doing one of the following:
> 1) read data
> 2) process data
> 3) plot data
> Since there are many different ways to process or plot data, it is
> nice to read the data into common blocks, so that when I decide to
> process or plot the data differently, I do not have to read it in
> again.
>
> If you have an easy solution on how to avoid common blocks, shoot. And
> why are common blocks bad? Is it the same reason "goto" statements are
> bad?

Oh, oh. *I* didn't want to get into it. I just wanted
to light the fire. :-(

OK, there is *nothing* inherently evil about either Common
blocks or GOTO statements. Both have a purpose, and I have
used both (I think, although I can't remember a specific
instance of either).

But what generally makes both Common blocks and GOTO
statements pernicious is how easy it is for inexperienced
programmers to substitute them for clear thinking and
well-written programs. The program I have been working
on for several weeks was brought to me because it is
nearly impossible for two "expert" users to get the program
to run the same way twice in a row, or--sometimes--to
even run at all. It depends entirely on what order things
are done and the current phase of the moon. Mostly, this
is because of the indiscriminate use of Common blocks,
and the fact that the left hand doesn't always know what the
right hand is doing.

If I saw a COMMON block in a program written by JD Smith
or Craig Markwardt, I probably wouldn't even think twice.
But when I open an e-mail and there is someone pleading for
"help" and I see Common blocks, I head straight for the
liquor cabinet.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: limited angle CT
Next Topic: IDL number output format problem?

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

Current Time: Sun Oct 12 05:59:57 PDT 2025

Total time taken to generate the page: 1.19958 seconds