Re: Yet again, The Sky is Falling! [message #52961 is a reply to message #52872] |
Fri, 09 March 2007 14:53   |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On Mar 9, 12:52 pm, David Fanning <n...@dfanning.com> wrote:
> Paul van Delst writes:
>>> 2. Don't pass the same named variable as both an input and output
>>> parameter in a routine call. (Or as two output parameters!)
>
>> Good lord. Why would anyone do *that*? (In any language) :o)
>
> Well, because it seems "natural", for one thing. Consider
> the POSITION keyword to TVIMAGE when you don't know for
> sure if the user wants to preserve the aspect ratio of the
> image or not, but you are keenly interested in knowing
> where the image ended up.
>
> That's, uh, about the only example I can thing of at the
> moment, but it seems a good one. :-)
I think you're thinking of a single parameter that is both an input
and an output. I think that is fine as long as that is clearly
documented. (READF/READU is another example of using this well.)
I'm talking about two parameters that are both passed a single named
variable (like Paul's mypro example). While legal, I don't think this
is a good technique for clear code.
Mike
--
www.michaelgalloy.com
|
|
|