Main Page | Report Page

 

  Computers Forum Index » Computer Languages (IDL-PVWAVE) » Error Handling Change in IDL 8...

Author Message
David Fanning...
Posted: Tue Oct 19, 2010 7:16 pm
 
Folks,

This change to ON_ERROR,2 error handling is driving me nuts!!

I've very close to just giving up on IDL 8. I do NOT want
to re-write the last 10 years of my IDL programs! :-(

Anyone else having this problem?

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
 
Paulo Penteado...
Posted: Tue Oct 19, 2010 7:16 pm
 
On Oct 19, 3:27 pm, David Fanning <n... at (no spam) dfanning.com> wrote:
Quote:

Alright, I'm going to quit whining about it. But
I still think changing the way error handling works
was a terrible idea and almost guaranteed to
antagonize long-time customers. (If I'm the only
one antagonized, as it appears, then perhaps
Coyote is right that "Nobody uses damn error
handling anyway!")

I do not feel strongly about this, but it is looking like it would be
better to either revert to the old behavior in the next release, or
make it a preference. I find it better to use a preference, that way
everybody can have their preferred behavior. The same way that in a
static compiled language there is the option to tell the compiler to
add traceback information and runtime checks.
 
Paulo Penteado...
Posted: Tue Oct 19, 2010 7:16 pm
 
On Oct 19, 5:09 pm, Paulo Penteado <pp.pente... at (no spam) gmail.com> wrote:
Quote:
I do not feel strongly about this, but it is looking like it would be
better to either revert to the old behavior in the next release, or
make it a preference. I find it better to use a preference, that way
everybody can have their preferred behavior. The same way that in a
static compiled language there is the option to tell the compiler to
add traceback information and runtime checks.

Though it may only take a few more bugs in Graphics where "on_error,2"
was used to make me feel strongly in favor of the old behavior. That
last one (with window()'s title) was found and dealt with, despite the
troubles with on_error and setting breakpoints.
 
Paul van Delst...
Posted: Tue Oct 19, 2010 10:31 pm
 
David Fanning wrote:
Quote:
Well, in functions the CATCH returns some value.
In procedures, it doesn't. Most of these ON_ERROR,2 calls
(but not all) are in functions, and I try to be a bit
careful about what I return. I'm not sold on the notion
of a generic CATCH handler.

Yeah, it's not straightforward I agree.

For what I do, I'm thinking about adopting
RETURN, !NULL
for my "generic" function error handler.

I've only thought about it for about 5 minutes, so there may be unforeseen pitfalls to this approach, but I prefer
convention over configuration.

Quote:
It is not really my library routines I am worrying
about. I'm pretty careful with Library routines.
I'm less careful when writing one-offs to
do science. It's these routines I am struggling with
at the moment. It's just disconcerting to get error
messages that don't mean a damn thing to me and do
nothing to help me solve the problem.

I'm sorry.... "one-offs"? I associate that term with throwaway code. So, two things immediately spring to mind:
1) does anyone really write "one-offs" anymore? Surprised)
2) If they truly are "one-offs", what the hell are you doing worrying about error handling? Just use
ON_ERROR, 0 !!

:o)

Quote:
Alright, I'm going to quit whining about it. But
I still think changing the way error handling works
was a terrible idea and almost guaranteed to
antagonize long-time customers. (If I'm the only
one antagonized, as it appears, then perhaps
Coyote is right that "Nobody uses damn error
handling anyway!")

I don't think we should stop whining about it. I'm usually the first in line to whinge about decisions made by ITTVIS
but in this instance, it didn't affect me at all since I use CATCH exclusively. (Similarly for the meaning of "-1" being
returned by an unsuccessful WHERE, etc etc)

Quote:
P.S. I'm not sure how to use a Ruby script. Do you have
that Perl script around? I can think of a few ways to use
that! Thanks.

Well, for ruby, on your *nix system type
$ irb
If you see something like
irb(main):001:0>
then you have successfully entered the interactive ruby shell and it means ruby is installed on your system. To run a
ruby script, you should be able to just type
$ ruby script_name.rb
to run it, but there may be some envars that need setting... can't recall.

But, regardless, I will ask my colleague if he has his perl script lying around (since I can't find it in our svn repo).

cheers,

paulv
 
David Fanning...
Posted: Tue Oct 19, 2010 10:51 pm
 
Paul van Delst writes:

Quote:
I'm sorry.... "one-offs"? I associate that term with throwaway code.
So, two things immediately spring to mind:
1) does anyone really write "one-offs" anymore? Surprised)
2) If they truly are "one-offs", what the hell are you doing worrying about error handling? Just use
ON_ERROR, 0 !!

Well, because of how much pressure I was feeling to
produce a result TODAY, I sometimes wrote what I thought
were one-offs. After that bit me in the rear about
a dozen times, I didn't care HOW LONG it took to write
the code, it would be reusable. I got a reputation as
a slow programmer (at least the first time they wanted
something done). After that, I was MUCH faster.
Reminds me a bit of IDL, in that respect. :-)

I guess what I really mean is "casual code", code
that is not really meant to be Library code, but
code that is useful to me, nonetheless. Maybe it's
code where I am exploring some kind of idea or
approach to the problem. I'm not really interested
in typing Catch paragraphs, but I do what to get
meaningful error messages.

Quote:
But, regardless, I will ask my colleague if he has his perl script
lying around (since I can't find it in our svn repo).

Appreciate it!

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
 
Axel M...
Posted: Wed Oct 20, 2010 9:58 am
 
On Oct 19, 9:13 pm, Paulo Penteado <pp.pente... at (no spam) gmail.com> wrote:
Quote:
On Oct 19, 5:09 pm, Paulo Penteado <pp.pente... at (no spam) gmail.com> wrote:

I do not feel strongly about this, but it is looking like it would be
better to either revert to the old behavior in the next release, or
make it a preference. I find it better to use a preference, that way
everybody can have their preferred behavior. The same way that in a
static compiled language there is the option to tell the compiler to
add traceback information and runtime checks.

Though it may only take a few more bugs in Graphics where "on_error,2"
was used to make me feel strongly in favor of the old behavior. That
last one (with window()'s title) was found and dealt with, despite the
troubles with on_error and setting breakpoints.

Maybe a guide from ITTVIS on IDL error handling would be helpful in
many situations. Is this available?
 
 
Page 1 of 1    
All times are GMT
The time now is Tue Jul 29, 2014 6:41 am