What would make you to switch to Scala ?
If you are negative on the switching to Scala, please state the reason as well (or upvote).
As with all StackOverflow Poll type Q&As, please make certain your answer is NOT listed already before adding a new answer
Edit: More discussion on Reddit [1].
Lack of mature IDE support. Scala is still quite much behind Java in its IDE support, although the situation is improving slowly. Many Java developers are used to the excellent IDEs that Java has, so some might not want to make the switch to Scala until its IDEs are closer to the quality of Java IDEs.
At this moment, IDEA's support is acceptable enough for me to begin using Scala in non-critical projects (it has some basic refactoring, navigation and code completion), but there are still lots of rough edges that would need to be improved (the biggest issues are some performance problems and the lack of Extract Method and Inline Method refactorings).
Nothing, I have switched to Scala.
This is like the "Why not D instead of C++?" question.
The newer language is in many ways superior, but until a language gains a critical mass of mindshare, there is not much point in switching. The mature tools, IDEs, open source apps, frameworks, operating platforms, jobs, fellow programmers, etc., etc., are all in the more dominant language.
Of course, it's a chicken/egg question, because somebody has to make the leap to the new thing or we never advance. Unless you want to work in a vacuum though, there is little benefit in being on the bleeding edge.
The biggest reason is that for every version x.y, x.y+1 is binary incompatible with x.y. That is, if you build a system on 2.7.4, and then upgrade to 2.7.6, it might be broken; if you upgrade to 2.8 (or whatever it gets called next) then it will be broken. And, if that wasn't enough, Scala 2.8 is source incompatible with its previous versions.
No-one in their right minds should build on a language whose foundation is constantly moving. It's like erecting a building on quicksand. Sure, it might look good from above, but it's only a matter of time before it falls to pieces.
While Scala has lots of interesting features that make it much more concise than Java (e.g. functions as first class objects [1] and easier object literals [2]), the syntax is too short and cryptic for my taste. The verboseness of a language should be aimed at the optimal ease of reading / understanding code for reviewers and maintainers, with a little bit of concession towards code writers but they only have to create code once.
I wish there had been an intermediate language between the two.... my preference would be something like Javascript with types (i.e. the not-yet-implemented Javascript 2.0 [3]) if it were compiled at compile-time, rather than compiled-at-runtime-and-interpreted. Javascript object literals ({a: "ha", b: [1,2,"spiffy"], c: function(x) {return 2*x}, d: {xx: 22, yy: null}}) are both readable and concise, and e4x [4] is the same way towards XML.
[1] http://www.scala-lang.org/node/128The main concern -- EDIT: for us for even considering -- moving from Java (the language) to any other language on the JVM is sheer maintainability. We create very long lived programs so we need to be concerned about future employees being able to look at the code base, understand it and enchance it.
So far the standard Java distribution has proven to be very robust and maintainable, so the incitament to look for something "better" is very small. Please note, that this includes everything inside the standard Java distribution, so it is perfectly fine to use XSLT to generate a complex web page or a regular expression (a language on its own) to split a string.
Using a "new" language is tempting but what if it fails to catch momentum and turns into another old, unmaintained, unused language that you are the only one in the whole world using? Just being in fashion does not mean it stands the tests of time, so you need to be careful.
Oh, by the way - consider which job is most attractive to future employees: "The main application is written in Java" or "The main application is written in Java, Prolog, Haskell, Lisp and Visual Basic" (where the Visual Basic compiler is written inhouse and you need to maintain it). Just a thought :)
My employer is heavily invested in Java is unlikely to move. Using Scala significantly would probably involve changing company, which I do not wish to do (although I'll consider offers).
Not familiar enough with Scala to move to it.
I am in the process of experimenting with Scala on a small project. I have programmed extensively in Java and Ruby.
I'm frustrated by Ruby's lack of strong typing, open module messiness, and the resulting lack of documentation (*). In my experience, Java's greatest weakness is the lack of closures, which makes many operations verbose and error prone. That might be the biggest reason I'm looking at Scala.
I am finding Scala on the surface to be beautiful and concise. On the other hand, the number of idioms, patterns, and rules that lead to WTF moments have been far more than I expected. For example:
scala> val line = "123abc"
scala> val Foo = """(\d+)(\w+)""".r
Foo: scala.util.matching.Regex = (\d+)(\w+)
scala> val Foo(a,b) = line
a: String = 123
b: String = abc
Ok, so there is an unapplySeq method on RegExp, which is called because of a "compiler trick" when this is on the left side of an assignment (or in a match). That performs an "extraction" on the right side and assigns the resulting List to the new vals passed into the constructor-like call. It's an interesting construct, and I'm still learning about its usefulness, but features like this make the language scary and unnecessarily complicated in simple cases.
Basically it's:
// Note: this doesn't work, since unapplySeq does not return a Tuple
val a,b = Foo.unapplySeq(line)
That makes a lot more sense to your average Bill, especially if we give unapplySeq a nicer name like, say, "match". Sure, there's some fancier stuff you can do with matches (the Scala kind, not the regexp kind,) although I'm not sure how much that buys you in most cases.
These types of tricks strike me as a violation of my keep-it-stupid-simple philosophy. Increasing the brainpower required to understand simple constructs unnecessarily is counter-productive. Perhaps that construct has it's place, but this doesn't seem to be it.
These complications are compounded by the tendency of Scala documentation to use rich examples instead of simple ones. For instance, the example for this in "Programming Scala" uses some advance type notation and for some reason introduces the Scala version of symbols, rather than showing a dirt simple example.
That said, hopefully I'll continue to be interested in Scala once I grasp all the concepts.
(*) If you think specifying an object type is too much work, you're unlikely to think documenting the type is much fun either. And if you're going to document the type, why not specify them programmatically? I digress.
I can't switch to Scala for my day job, because most of the time I don't get to choose which programming language is being used on the project I'm working on, and there are not many clients that are willing to use Scala (yet).
For my hobby projects, I've been using Scala for the past few months and I like it.
I don't think there is anything inherent in the Scala programming language itself that would prevent it from becoming popular.
The lack of really good IDE support (refactoring, debugging, profiling) is one thing that needs to change to help Scala become more popular.
Team inertia is the biggest problem: we have spent a lot of energy recently moving most of our code away from scary Perl & C CGI stuff to slightly less scary things in Java. Another paradigm jump to a FP-style language would be too much. (And, of course, politics is as much a part of this as the technical considerations)
Although Scala is perhaps a better language than Java, it is obscure. It seems highly unlikely that Scala will ever become big like Java. Scala needs to become, or look as if it will become, big before I will switch.
My observation of others, as I wont code on the JVM w/o Scala personally.
1) Familiarity - FP, even a FP hybrid, can be disorienting for an OOP programmer.
2) Many programmers are "conservative" or, in Myers-Briggs typing, "preservers" - The status quo has been good enough for X years, why change it?
3) Mastering new languages takes time.
4) Scala is still evolving as a language while Java proper is relatively stable in terms of language design.
Why I did make the switch.
1) I like FP already - I love Haskell, for example.
2) I prefer composition over inheritance, and Scala is a good fit for this type of thinking.
3) I like Erlang's actor model, and prefer it to manual thread management
Java is a proven development environment for about 15 years or so. Scala is new. Why move to something new when we already have something reliable?
Number of jobs available in Java v Scala.
I've dabbled in JVM languages and have at least a passing knowledge of all the major ones. From what I've seen, I am more tempted by Clojure than by Scala. As soon as I learn Haskell a little bit better, I'll be starting in on Clojure.
Previously I had two excuses for not using Scala: performance and lack of a good IDE.
Now Scala's performance is on par with Java, and Scala plugin for IntelliJ IDEA looks quite mature (and works). So the only excuse is my inertia and laziness. I can write Java almost like I can write English (or even better), in a subconscious way. When I code in Scala, I have to, you know, think. It is exciting, but, for now, slower. And I have projects to deliver on time.
Already seduced off of the JVM by Python. If I needed do do something on the JVM, I'd try to do whatever in Jython.
For me,I already switched to scala, and love it and don't want java anymore but in my compagny not, because :
For me, personally, it's the TIME problem.
For a more logical answer I think there are 3 major road blocks:
I studied Scala for a while and as others have pointed, Scala has some advanced language features. Does the benefit of new language features trump the 15 years of Java code that is out there.
At least Scala and languages like Clojure started out on the right foot by being targeted for the JVM. Sure there are issues with the Java runtime but a JVM language will see way more adoption than something completely new like Haskell.
Scala syntax highlighter: http://code.google.com/p/lightscalaplugin/
Note: the highlighter isn't robust but the color code matches that of the Java language. It is lightweight and has worked on many versions of Eclipse.
I think the biggest problem with Scala is that its one of the new languages on JVM. If I had moved to jRuby/Groovy/etc in the past would I now be re-writing that code in Scala? Should the whole team know all languages for JVM? Until there is one single best(most popular) language for JVM moving to it is not a good idea. Next week there can be another great language that could make scala look like really weak language. people should stop inventing languages for JVM, because they are hurting adoption of existing languages. if they have cool idea than put it in scala or groovy.
Scala does not fully integrate with the tools. It's easy to run a pure Scala project or a simple project with Java and Scala sources. But...
Scala specs (unit tests) hardly integrate with Surefire. Surefire is able to run them but specs don't generate XML results. Not good when using a continuous integration server. You have to resign from writing such awesome tests.
class ScalaNativeTest extends SpecificationWithJUnit {
"'hello world' has 11 characters" in {
"hello world".size must_== 11
}
}
Another thing - no way to run both JUnit, TestNG and Specs tests - TestNG tests won't run then and throw an exception. Also, I wasn't able to run Scala Test [1]. Scala Test documentation doesn't even mention Maven.
If you want to develop things in the newest Scala 2.8, you won't be able to use JARs built on Scala 2.7. ScalaTest 1.1 runs on Scala 2.7 whereas 1.2 runs on Scala 2.8. But you are likely to find libraries that do not have a Scala 2.8 version in the repo.
Google hardly helps me. Noone seems to integrate Java and Scala the way I try to do.
[1] http://www.scalatest.orgWhat is stopping our team from switching to Scala? Programmers indoctrinated with java :) Honest and true opinion.
Oh, and lack of a decent IDE.
I've never heard of it.
More discussion on Reddit [1].
[1] http://www.reddit.com/r/scala/comments/anllu/poll_what_is_stopping_you_from_switching_from/No (private) time to learn Scala - spending too much time on forums :-)
As soon as there is a Scala job assignment I'ld have (non-private) time to learn it... but that's not very likely to happen that soon :-(
The Scala compiler is too buggy for my taste. While implementing the Universal Machine for the ICFP Contest 2006 [1] I ran into 4-5 compiler bugs (usually exception thrown somewhere deep inside of Scala for no apparent reason). For a program that is only ~200 lines long, that's really bad.
[1] http://www.boundvariable.org/task.shtmlIt has such an ugly syntax, and if you don't wanna code Java in it, you'll get unreadable code. So, no win.
I'm not switching from Java to Scala because I don't use Java.