|
|
| XP is just a number | |
| PerlMonks |
Buzzcutbuddha: (Java Exception Handling)Re: What is it about perl that makes perl so cool?by buzzcutbuddha (Chaplain) |
| on Dec 11, 2000 at 12:12 UTC ( [id://46070]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
>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 Section
Meditations
|
|
||||||||||||||||||||||||