Don't ask to ask, just ask | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
>1) try / catch
>I'm not the most experienced java programmer (a year or so
>while i was at school), but i really disliked having to >check for errors from a method with two separate blocks of >code. I disliked even more the fact that you had to know >the specific exception that each method would throw. Actually I believe that the Java exception handling is quite elegant. As a developer, you should already have an idea of where your errors might occur (hence Perl's DIE, which you place after where you think a problem will occur), and what type they will be (you expect to get an int and the user inputs a double brings about a ParseException) and so writing Try/Catch statements makes sense. It localizes the error handling to the code that is most likely to bomb out. Just my $0.02 In reply to Buzzcutbuddha: (Java Exception Handling)Re: What is it about perl that makes perl so cool?
by buzzcutbuddha
|
|