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

Home » Public Forums » archive » Yet again, The Sky is Falling!
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: Yet again, The Sky is Falling! [message #52967 is a reply to message #52872] Fri, 09 March 2007 11:13 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On Mar 9, 11:36 am, David Fanning <n...@dfanning.com> wrote:
> Paul van Delst writes:
>> But, then it's not an input parameter. It's an output.
>
> It generally has to get into the program somehow. :-)
>
>> I'm f95-centric, and I know it doesn't apply completely to IDL for a number of reasons,
>> but I don't think people should new code where the functionality depends on *how* the
>> arguments are passed (i.e. by value or reference).
>
> I'm not saying "pass by reference" is not dangerous, it is,
> but it is no more dangerous, it seems to me, than a dynamically
> (and weakly) typed language. Goodness, one of the reasons I LIKE
> IDL is because you can do all these weird things that would
> get your knickers in a snit in some other language.
>
> Sure, you have to learn a few rules, and usually you learn
> them the hard way, but you only have to learn them three or
> four times before they get cemented in your brain. I think
> it is a small price to pay for a LOT of power.

I agree that pass by reference can be dangerous and very useful. To
clarify my "moral":

1. Document clearly which parameters are input, which are output, and
which are both (i.e. modifying a variable "in place"). Don't change
the input ones! If you need to have a default value for that input in
the routine, create a new local variable.

2. Don't pass the same named variable as both an input and output
parameter in a routine call. (Or as two output parameters!)

Mike
--
www.michaelgalloy.com
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: mpeg creation problem
Next Topic: reading many files

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

Current Time: Sun Oct 12 12:22:48 PDT 2025

Total time taken to generate the page: 0.95771 seconds