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

Home » Public Forums » archive » Re: Parameters for Dummies
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Parameters for Dummies [message #30972] Sun, 02 June 2002 23:45
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
David Fanning wrote:
>
> Sean Raffuse (sean@me.wustl.edu) writes:
>
>> is there any time when I should really be using a positional parameter
>> instead of a keyword parameter? The more I do, the less I see why a
>> positional parameter would ever be better. Yet, I'm sure they're there for
>> a reason. Please enlighten me, oh most wise discussion group.
>
> Here is a loose rule of thumb: Positional parameters are
> for *required* parameters. Keyword parameters are for
> everything else.
>
> Cheers,
>
> David

I agree to this but sometimes I am angree about not chooosen
a keyword parameter.
This is when I like to use keyword inheritance by _extra and so on.



regards

Reimar


--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml
============================================================ =======
Re: Parameters for Dummies [message #30978 is a reply to message #30972] Fri, 31 May 2002 11:11 Go to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
David Fanning <david@dfanning.com> writes:

> Sean Raffuse (sean@me.wustl.edu) writes:
>
>> is there any time when I should really be using a positional parameter
>> instead of a keyword parameter? The more I do, the less I see why a
>> positional parameter would ever be better. Yet, I'm sure they're there for
>> a reason. Please enlighten me, oh most wise discussion group.

> Here is a loose rule of thumb: Positional parameters are
> for *required* parameters. Keyword parameters are for
> everything else.

I second that.

I've encountered IDL software where the developer decided to make EVERY
parameter a keyword parameter, even the required ones that you have to enter in
every time. I found all that typing quite a pain. (On the other hand, I also
remember the bad old days, before IDL keywords were invented, and all
parameters were positional, even if you had twenty of them!)

William Thompson
Re: Parameters for Dummies [message #30979 is a reply to message #30978] Fri, 31 May 2002 10:42 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
David Fanning <david@dfanning.com> writes:

> Sean Raffuse (sean@me.wustl.edu) writes:
>
>> is there any time when I should really be using a positional parameter
>> instead of a keyword parameter? The more I do, the less I see why a
>> positional parameter would ever be better. Yet, I'm sure they're there for
>> a reason. Please enlighten me, oh most wise discussion group.
>
> Here is a loose rule of thumb: Positional parameters are
> for *required* parameters. Keyword parameters are for
> everything else.

An interesting diversion which connects to both Sean's and David's
points. There are a few astronomy software analysis tools (IRAF and
FTOOLS to be specific) which name *all* of their parameters. The
required parameters can be given positionally, in which case you don't
need to give the keyword name, but otherwise you can give all the
parameters as named keywords.

This would be nice for IDL, and seems to be the kind of thing that
Sean was thinking of, but it certainly doesn't exist in IDL as it
stands.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: Parameters for Dummies [message #30981 is a reply to message #30979] Fri, 31 May 2002 09:22 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Sean Raffuse (sean@me.wustl.edu) writes:

> is there any time when I should really be using a positional parameter
> instead of a keyword parameter? The more I do, the less I see why a
> positional parameter would ever be better. Yet, I'm sure they're there for
> a reason. Please enlighten me, oh most wise discussion group.

Here is a loose rule of thumb: Positional parameters are
for *required* parameters. Keyword parameters are for
everything else.

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL 5.5 "% Temporary variables" messages
Next Topic: bwfill in IDL?

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

Current Time: Sun Oct 12 00:40:42 PDT 2025

Total time taken to generate the page: 0.48023 seconds