*
The moose likes Scala and the fly likes How does Scala compare with other scripting languages on the JVM as regards Exception Handling? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » Scala
Bookmark "How does Scala compare with other scripting languages on the JVM as regards Exception Handling?" Watch "How does Scala compare with other scripting languages on the JVM as regards Exception Handling?" New topic
Author

How does Scala compare with other scripting languages on the JVM as regards Exception Handling?

Lanny Gilbert
Ranch Hand

Joined: Jun 11, 2002
Posts: 103
In some forums, I've read that <insert your JVM language of choice that is not Java here> does away with the ugliness of Java Exception Handling.
Does Scala have a easy to use and elegant method of exception handling?

Thanks!
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1280

Hi Lanny,

do you really mean exception handling in general? You still have to or better say should handle exceptional conditions in your applications. But I guess you're talking about the annoying boilerplate code to handle exceptions in Java when you have to deal with I/O resources for example. The usual try-catch-finally all over your code just to read a line of text from a file ;-)

This can be handled far less verbose and more elegant with closures for example. Because Scala comes with support for closures as most other languages on the JVM it can help to simplify exception handling a lot. Not sure if this is what you read but at least it is part of the solution regarding the "ugliness" of exception handling.

Marco
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How does Scala compare with other scripting languages on the JVM as regards Exception Handling?
 
Similar Threads
Where to post Scala discussions
Python lossing place against Scala?
Which is better Groovy or Scala?
Exception handiling
Any JVM based language and JRebel