Learning Scala is such a pain. Either you follow a large book completely and master it across several months/years or go through overly complicated online guides and get discouraged. I understand it's a large, advanced language, but the community has to seriously work on making things a bit easier for beginners like me. Just look at how easy it is to learn Go or Rust, their official tutorials are amazing and free on…
I totally agree with you, as someone who had to learn it quickly for a new job. A bit of hearsay indicates that a former VP of Engineering at Twitter is not sure he would have gone with Scala again because of the on-ramp for new devs (https://www.quora.com/Is-Twitter-getting-rid-of-Scala).
Even if someone (a fan of Scala) doesn't believe it's that hard, the fact that this comes up again and again should really be an indication that it's truly an issue for people new to the language [1]. It is difficult, and it is intimidating. I would not have learned Scala if it weren't for the extrinsic push of learning it for a job.
[1] This applies to other things that people new to a language constantly complain about: Python's problem with v2 and v3, etc.
Learning Scala is such a pain. Either you follow a large book completely and master it across several months/years or go through overly complicated online guides and get discouraged. I understand it's a large, advanced language, but the community has to seriously work on making things a bit easier for beginners like me. Just look at how easy it is to learn Go or Rust, their official tutorials are amazing and free on…
This might be true, but I don't think it is hard as the general opinion is. I think it's mostly about the technique and patience. You can't expect miracles at once or a wow factor. I generally started using it for smaller projects or parts where I could experiment a bit, and started using it as a better Java. I also played CodinGame with Scala. As things caught pace I started evolving it a bit and looking into refact…
But compare this to someone's experience with Python, Ruby, JavaScript, Go, or (maybe) Rust, where they are much more rapidly productive, and they actually have that immediate wow factor. I think this may also apply to "lighter"-weight Scala alternatives like Kotlin/Ceylon one day, depending on their adoption. So I think Scala pales on this dimension relative to its competition.
My biggest problem with Scala is that it's too powerful. Reading code I've written weeks or even days later is painful. Conciseness is not always good.
In what ways does Scala you've written end up being unreadable just days later? I honestly find that Scala code is some of the simplest and easiest to reason about of any language. Writing Scala has honestly been such a joy, it's easy to refactor, easy to read and write, and I almost never miss something -- if it compiles, Scala code is usually correct I find.
I think that, if you're not super aware of most of the features of Scala, that it can be confusing to understand what certain syntax means (implicits are a big one!)
Just the infix operator syntax plus implicits can lead to stack trace confusion all around
And try understanding some of the type signature funkiness! It can be difficult
I definitely think that Scala is a harder language than most to grasp, if only for the feature support not seen since C++
The real question: is it worth it? Up to now I could successfully avoid learning Scala. My problem with it is the complexity that the language by itself introduces and the readability of code that comes out at the end. Maybe I am just valuing simplicity too much when it comes to programming languages. Anyways thanks for the impatient guide!
If you have to use the JVM and don't want to code in Java, your options are Scala or Clojure (maybe Groovy?). Then it comes down to essentially the tradeoff between a static typesystem vs macros (imho, ymmv etc). I second the reccomendation for Chuisano and Bjarnasaon's "Functional Programming in Scala".
Apache Groovy is really for those quick'n'dirty scripts manipulating and testing Java classes -- that's its original use case. Later it added a MOP so Grails, a knock-off of Rails, would work, though Grails use is fast waning -- not many people upgraded their websites to Grails 3, or start new projects in it. Gradle then started using it as a DSL, so there's now a few thousand sites using the non-Turing Complete features of Groovy in 20-line build files. When Groovy 2 came along with static compilation and eventually targeting Android, not many people upgraded, prefering to stick with Groovy 1.8. The programmer who put the static compilation into Groovy now works at something else, and no-one's replaced him. So really Groovy's not a contender for building systems in the way Scala or Kotlin are, which were both designed for static compilation from the ground up. Nor does Groovy have syntactic macros the way Clojure has -- you need to write screes of Java code to implement a single annotation.
This might be true, but I don't think it is hard as the general opinion is. I think it's mostly about the technique and patience. You can't expect miracles at once or a wow factor. I generally started using it for smaller projects or parts where I could experiment a bit, and started using it as a better Java. I also played CodinGame with Scala. As things caught pace I started evolving it a bit and looking into refact…
But compare this to someone's experience with Python, Ruby, JavaScript, Go, or (maybe) Rust, where they are much more rapidly productive, and they actually have that immediate wow factor. I think this may also apply to "lighter"-weight Scala alternatives like Kotlin/Ceylon one day, depending on their adoption. So I think Scala pales on this dimension relative to its competition.
It's a lot like learning SVN vs Git, SVN requires fewer steps to do a commit so you can be "productive" faster. Once you learn Git though you won't care that it took you a bit longer to learn. Prioritizing being productive immediately and instant gratification isn't always the best in the long term.
As someone who's seeing plenty of Scala uptake around me that's a rather surprising claim with no supporting evidence. These days I'm writing 90+% of my code at work in Scala.
Learning Scala is such a pain. Either you follow a large book completely and master it across several months/years or go through overly complicated online guides and get discouraged. I understand it's a large, advanced language, but the community has to seriously work on making things a bit easier for beginners like me. Just look at how easy it is to learn Go or Rust, their official tutorials are amazing and free on…
I actually had the opposite experience. Yes, Scala takes some time to digest but I didn't find it particularly hard. I come from a C# background and Scala just makes things so much easier to code once you get the hang of it. On the other hand, I tried learning Go before picking up Scala. Something about it's handling of concurrency just didn't sit well with me. Perhaps it was because it was so different for C#. I nev…
I shared the same sentiment the first time I picked up Go. Coincidentally, we also share the same background (I've been a C# developer for years). However, I hold no longer the same sentiment toward Go. Yes, it forced me to think dramatically different than it was the case before, but nowadays Go is just a breeze to work with. Hence, I even do coding challenges in Go just because it's fun.