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

Home » Public Forums » archive » CASE statement
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: CASE statement [message #27021 is a reply to message #26552] Mon, 08 October 2001 09:55 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
JD Smith (jdsmith@astro.cornell.edu) writes:

> The paranoid may therefore use:
>
> if n_elements(key) ne 0 then if keyword_set(key[0]) then do_something
>
> or do you contend that key=[1,0] should also be "false"?

Thought I would just comment on this tread, in general.

Those of us who write a lot of IDL programs
have had to learn (of necessity, often) to
write defensively. For example, I never check
a string in a CASE statement without wrapping it
in a STRUPCASE call. But, you can either write
VERY defensive code, or you can get your work
done. :-)

Keyword_Set is surely one of the most abused
functions out there, but even using it improperly
doesn't cause many problems, most of the time.
I'm all for proper programming practice, and
I think I do my share to let people know the
"right" way to do things (Stein Vidar be dammed) :-).
But, folks, the people using these programs
are adults. *We* are adults. We know both we
and they are going to make mistakes.

When that happens, fix the error and move
on. Spending hours anticipating that someone
is going to pass an array, of all things, to
one of our keywords is wasted work, it seems
to me. If it happens once, I'd fix it. If it
happened twice. I'd fix it and think about it.
But until they pass me three times down the line,
I don't give up the center of the court for
anything. :-)

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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL LINUX support question
Next Topic: interpol

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

Current Time: Sun Oct 12 00:56:50 PDT 2025

Total time taken to generate the page: 2.07827 seconds