Scala is probably the most pragmatic functional programming language to get a job in. It's on the JVM and you can use all the Java libraries, and it also lets you fall back to an imperative style if you need to.
Scala has a very interesting confluence of features. It's statically typed, which some people think is very desirable. It supports functional programming very well. It has strong concurrency support. It has an amazing breadth of libraries from the JVM. It has a lot of niceties that make your code shorter. Overall, it's a pleasantly practical language, aside from the fact that the type system makes Haskell's look benign and conservative.
As someone who loves typed functional programming and has used both Scala and Java, I oddly prefer Java; it's much easier to reason about. I find Scala almost impossible to make sense of due to the language's complexity.
I started working for a company that does a lot of Scala a few months ago. It's my first real exposure to it.
To me, Scala's biggest benefits are just the language itself. So many little things that I couldn't do in Java, I can do with little effort in Scala. I can write imperative code if I really want, but I have all the benefits of functional programming available too.
Java let’s you do most of the work, Scala let’s me produce elegant enough solutions that the complexity means I have job security. Thus, if you’re learning Java for career reasons, Scala seems to be a natural compliment.
Starting adopting Scala about 18 months ago after much frustration with Java's copious boilerplate. It's like a breath of fresh air and feels in many ways like a dynamic language thanks to type inference. We still use many Java libraries but interfacing with Scala is a breeze. It's got more up-take than Kotlin or Ceylon and I'd say the only decent alternative on the JVM is Clojure but that's a different beast. If you're in a position where your after functional programming on the JVM then consider not waiting years for Java to catch up. Give Scala a go.
Scala hits such a sweet spot (at least for me). It's a pleasure to use, the language is so flexible, and you can write very nice, succinct and easy-to-reason-about code. The support for higher-order functions and closures, etc is really nice. I've been doing some android development in Scala and it has a huge impact on productivity.
I initially tried scala when getting back to using a language on the jvm. While scala boasts less verbosity than java I felt like the syntax became more complex than what I was accustomed to and slowed my progress if you can believe that. Java was the first real OO language I learned and then moved onto ruby. Currently working with C. I think in pursuing functional programming I'll probably go with something pure like haskell, ML, or lisp.
Agree completely with everything you said and your observations regarding job market. I’ve been doing Scala for several years and I also would not recommend it to anyone unless they have a deep desire to do pure FP(functional programming) on the JVM. The ecosystem/libraries are unnecessarily complex IMHO.
If you want FP-Lite, I recommend Kotlin, it’s very pragmatic, reasonably functional, and mid way between Java and Scala. I actually converted all my personal projects from Scala to Kotlin, including my framework https://github.com/slatekit/slatekit which took about a 4-6 weeks from the original code base.
Unfortunately I think you're right that Scala is too complex to displace Java. If you're looking for a functional language you can use to to real work though, Scala is just the ticket and it's really not that complex once you start using it. None of the above-average programmers I've worked with would have any trouble picking it up with a little motivation.
Personally I find myself much more productive in Scala for anything non-trivial than in any other language.
As suspected by hisham_hm, I'm paid to code in Scala.
At my previous job I tried to introduce some functional languages without much success. The stack was C++/Java and a lot of Python. I learned Scala because it runs on the JVM and I thought that may help.
Later I moved to another city and when looking at job offers I saw a few Scala offers (and no Ocaml in sight) so I settled on Scala.
IMHO Scala gained traction because it runs on the JVM. It's easier to train Java devs because you can start by writing Java-in-Scala and incorporate specific features as you go. The web ecosystem is nice (at work we're using Play.) There's also a few killer apps, like Spark.
I'm currently trying to become as proficient in Ocaml as I am with Scala, but I'm already working with Scala 8+ hours a day so it's not that easy.
Despite nemoniac's post, I think you're on the right track with Java. There's plenty of Java work out there, and modern Java is a better than average language to work with.
Given that you've done some functional programming, you might also want to investigate Scala. There's probably not too much Scala work out there right now, but you might be able to evangelize it for some appropriate workloads once you're doing Java development. It completely interoperates with Java (it runs on the JVM also). I think it's one of the best designed modern languages.
I want the power of types and functional programming and Actor concurrency, but am leery of doing anything practical with languages like Erlang or Haskell.
Plus, Scala runs on the JVM and is thus compatible with all of Java's libraries. The day I have to read a UTF8 string backwards I want to use some standard library, not get creative with a linked list of ints.
What about Scala? It's probably my favorite language: incredibly expressive, FP+OO, higher kinded-types, great tooling, flexible performance (you can adjust between elegance and java/C++-like performance very easily), and runs on the bullet-proof JVM.
I like Scala as a language. I started using it in 2010 on an open source project (BigSense.io) and since then my Scala has improved considerably (improved meaning I've learned how to use the language a lot more efficiently).
If you want to get into it, get into it because you want a clean functional language on the JVM. That being said, some of the syntax in Scala ... oh god.
I really wish, before starting Scala, I had read through The Little Schemer and attempted either Scheme or Haskell. Functional programming is a different way of thinking.
You can use Scala as a cleaner Java, or you can really use a lot of the idioms in Scala to make cleaner, shorter and less error prone code.
reply