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

Home » Public Forums » archive » Re: Error Handling Advice
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: Error Handling Advice [message #82712 is a reply to message #82711] Mon, 14 January 2013 08:51 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
hello,

On 01/14/13 10:05, David Fanning wrote:
> John Correira writes:
>
>> Is there a technical reason behind not making a keyword a required
>> argument, or just a personal preference based on experience? I find it
>> harder to interpret a long series of positional parameters as opposed to
>> a list of somewhat descriptive keywords.
>
> It is not a technical reason so much as a visceral response. :-)

Ha! Good answer!

FWIW I apply the IDL parameter/keyword type for my Fortran95/2003 code.
E.g. if I have

subroutine mysub(a,b,c,d)
real :: a, b
real, optional :: c, d
...
end subroutine mysub

the documentation for this routine's calling sequence is always listed
sort-of like an IDL routine:

! call mysub(a, b, c=c, d=d)

to indicate that "a" and "b" are mandatory arguments, and "c" and "d"
are optional.

> I suppose I write programs differently than most people, but I've never
> had a need to define more than three required arguments in a program
> EVER, as far as I can recall. I'm sure there is a reason for the 10-12 I
> sometimes see in programs I haven't written, but I can't imagine what
> that reason is. People who come to me with those kinds of programs are
> always confused. I just assumed that was one of the reasons why. ;-)

My rule of thumb: More that 3-5 required arguments -> collect them in a
structure! :o)

cheers,

paulv
[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: Using function after .reset
Next Topic: Transparent and Overplotted Images with cgImage

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

Current Time: Fri Oct 10 08:35:24 PDT 2025

Total time taken to generate the page: 1.04281 seconds