• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
reply
    Bookmark Topic Watch Topic
  • New Topic