I've noted that IDE support is nowhere near as good, but the language itself supports functional programming idioms much more cleanly.
|
closed as not constructive by MichaelT, gnat, thorsten müller, Bart van Ingen Schenau, Jalayn Apr 17 at 12:38
As it currently stands, this question is not a good fit for our Q&A; format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.
I've been programming Scala for more than one year now, so I'll try to set myself back a year to answer this question.
The points above were more or less what I thought of Scala before I started to learn it. In the course of a year, here is what I found out:
|
|||
|
As a Java programmer, I initially found Scala interesting. However, after dabbling with it for awhile (and running into nearly all the positives/negatives already listed by others), I was left feeling very "meh" towards it. The language improvements are offset by the lower availability of toolsets. I just couldn't come up with any defining reason to switch over. It's good, but it's not "better enough" to make a case for switching. Doesn't have that subjective excitement factor either (like Clojure seems to). |
|||
|
Scala is complex. No way around it! Its syntax is extremely flexible and can be customized in numerous ways (above all operators / infix notation) - and the type system has more different features than any other language I know. So things aren't that straight as e.g. in Haskell: Typeclasses to cover them all. As Scala tries to put together functional programming, OO, procedural programming and java libraries as well as own ideas, we finally end up with lots of concepts that somehow seem to go "in the same direction":
Choosing among them seems difficult at first and one might easily wonder if one has found the correct solution to some problem. It's even easily possible to produce hacky stuff by abusing But the interesting thing is: Scala works. It's sometimes hard to understand why (especially figuring out through what implicit conversions + inheritance + ... some object has got functionality Write Scala as straightforward as possible and it will work. Don't get confused by everything that is possible and just use what you need. And if you need something, you can be sure that somehow Scala has it ;) And the better you get, the more you'll be able to customize Scala with operators, implicits, monads, funky syntax ... and finally get something close to a DSL that will perfectly address your problem. After all, you have always the possibility to just use Scala as a much much better Java with cleaner, easier syntax, type inference and some functional features. |
|||
|
Here is what sucks about Scala:
To avoid being mistaken for a Scala-hater, here is what I love about it:
|
|||||
|
About one year ago, as I became more and more frustrated about the future of my startup's products if I continued to use Java, I decided to give Scala a try. I was already programming in JavaScript and Python at the time, Ruby was also a good alternative, but I was looking for a statically typed language, preferably one that could run on the JVM. I really tried to like Scala, I really did, but I found it's code utterly ugly and hard to understand. I dramatically wondered that if Scala was our best answer to Java, then I was surely screwed and sentenced to continue working with a language I didn't liked after all... Fortunately, not too long afterwards, I found out about Fantom. Oh man, did I loved it! To me, it was like american's splendor answer to german bureaucracy! It matched the requirements I was looking for in Scala, but much more elegantly. It had Vim, Eclipse and Netbeans integration, a nice web framework, mature products running with it, a small but incredibly helpful community... Dynamic and Static typing! I rejoiced! (I could continue but this post is meant to be about Scala, not Fantom, so I stop here. My preference is clear, nevertheless there's this post comparing the two. I never could understand why Fantom gets so little attention when compared to Scala. But apparently I'm not the only one, if you listen to this podcast [mp3] until the end.) |
||||
|
I like Scala for many reasons, but there is one that is often overlooked: its simplicity. Scala might not be as simple as, say, Oberon, but it is quite a lot simpler than some other languages. The Scala Language Specification is ~160 pages, the Java Language Specification is ~600 (just the language, not the JVM or the libraries!), the ECMA-334 C# Language Specification (which AFAIK corresponds to a subset of Visual C# 2.0) is ~440 pages (this is without stuff like LINQ query comprehensions, lambda expressions, extension methods, generic co- and contravariance, |
|||||||||||||||||||
|
I really like the Scala library's more granular types. It seems like the new collections library was well thought-out. I also like how it reduces the amount of code required for simple classes, and the functional concepts it adds. Its type inference is also very helpful. It feels like Java without the training wheels. After using C# for a while, Scala actually feels like a competitor, with Java still useful but being left behind. |
|||
|
When I initially dabbled with Scala 2 years ago, it looked alien and intimidating to me. At some point I discovered that the core language is actually much simpler than Java, but its syntax and semantics are so flexible that you can create new language constructs like it, even without a macro feature. I have since completely switched to Scala for all my Java projects, because it lets me write without too much boilerplate code. I like Clojure, but there are situations, where the platform needs you to compile to static bytecode (Android, applets, ...) and while you can do that, in Scala, it's just there. While Scala lets you solve many problems in a functional way, I often find problems where using classes feels more natural. That makes things a bit more complex, but nowhere near the complexities and pains of C++. The biggest takeaway for me when I really started learning the language was that I could program just I did in Java, just without the noise (a little bit like when you start Groovy), but eventually you want to try to dive deeper into the power of the language - it grows with you. About the IDE question: After using Emacs for everything, all my IDE issues went away :-) |
||||
|
It's an excellent language that is simpler than Java in many ways. Most people won't like it, Java programmer or not, for the same reasons that most people, programmers or not, don't like learning new programming languages. I suspect that most people who learned a programming language did not even like learning that. If you're worried about a language being as complicated as C++, I would avoid Clojure like the plague. Whining that Scala is more complicated than Clojure has become the fallback argument for people who are completely ignorant regarding one or both languages. Clojure has macros, which means you can alter the language's syntax as much as you want, giving you not just "a myriad of different ways of doing things" but an almost infinite number of ways of doing things. And none of this new syntax the programmers are creating with the macros will be documented anywhere in the language specification. "But we can avoid using macros or regulate which ones are allowed in our code", you say. Congratulations, you're now having "to artificially limit what language features you're going to use and what not", which is exactly what the babbling idiots who are using Clojure of Scala used as their reason for avoiding Scala to begin with. |
|||||||||||||
|
Well, I think Scala is too complex. It feels like C++ in that it has a myriad of different ways of doing things. Some would call this "richness", "expressiveness" or "power", but your mileage may vary. In many real world projects you would have to artificially limit what language features you're going to use and what not, so that all developers involved could speak the same subset of the language. For functional programming I prefer Clojure, which is way simpler than Scala. Let the holy war begin ;-) |
|||||||||||||||||
|