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

Home » Public Forums » archive » Re: can i place a job advert
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: Commons, Was: can i place a job advert [message #28217 is a reply to message #28126] Mon, 26 November 2001 11:21 Go to previous message
Richard Younger is currently offline  Richard Younger
Messages: 43
Registered: November 2000
Member
Paul van Delst wrote:
>
> Well, my comment was meant to try to get those that swear profusely
> that common blocks are a Bad Thing to explain why. I place common
> blocks in the same category as GOTO statements - if used incorrectly
> they can lead to unbelievably bad source code that may or may not
> work.

Well, the snooty Computer Science answer to this is that common blocks
or global data completely separate the context of the data from its
content. Similarly, with GOTOs, it's easy to separate the context of
one snippet of code from another. When you have a global variable, you
(the indefinite you, which could actually include someone else :-) )
have no real idea what sort of code is using that data. I think the
idea of prohibiting them is to remove the chore and responsibility of
keeping track of the context from anyone else (or any other process of
yours) that wanders along. It's a Good Thing(tm) when the programming
system you use discourages methodologies that tend to cause confusion
and mistakes.

Admittedly, common blocks have some features apart from purely global
data that discourage errors. They have to be specifically invoked, can't
be resized (upwards), and usually IDL projects aren't so big that one
person can't keep track of a set of well controlled commons. The
examples given why commons in IDL specifically are bad seem to involve
doing multiple things at the same time, or with multiple copies of the
same program running.

For myself, I seem to get along nicely without commons. Instead, I
generally use objects, which can carry lots of data implicitly while
still keeping them in context for many routines. The only application I
have thought seriously about using common blocks is a global hardware
lock on some I/O hardware. Even then, I could use a file, since I don't
need to access the lock often. I don't do nearly as much heavy-duty
object graphics (I'm still in line to buy that book when it comes out,
David!) or widgeting as many on this group, though.

Mind you, I'm not supporting banning commons as dogma, but I think there
are enough general objections to them to ask people to think a bit
before they rush out and use them everywhere they can.

Best,
Rich

--
Richard Younger
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Capturing screen output
Next Topic: IDL 5.4 on Solaris? Please test

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

Current Time: Wed Oct 08 19:05:56 PDT 2025

Total time taken to generate the page: 0.00438 seconds