Alex Rivera | Logout

To use or not to use Scala for new Java projects?

Asked 2009-11-14T12:18:41.763
11

I'm impressed with Twitter and investigating to use Scala for a new large scale web project with Hibernate and Wicket. What do you think about Scala, and should I use it instead of Java?

EDIT: And, do you think Google's Noop, Fan or Scala can take the leadership from Java in the near future, which one have chance in your opinion?

Edit
Report

1 Answer

6

Here are the pros and cons of Scala relative to Java IMHO:

Pros:

  • Much more concise syntax for idioms common in modern Java code
  • Closures
  • More powerful type system including mixins
  • Pattern matching
  • Great REPL, 2.8 will even have tab-completion

In summary: You get a lot more functionality with a lot less code than Java

Cons:

  • IDE support is still of alpha or beta quality, although IDEA has the best support currently
  • The standard library is not immune to changes with each new version (2.8 will have backwards incompatible changes)
  • The standard library had significant bugs at least as recently as a year ago (when I found one in the JSON support)

I think Scala will be ready for major production use in 6-8 months, but I wouldn't bet my project on it today.

answered 2009-11-14T15:43:18.463

Your Answer