20 ms·
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 guide
by pcx 11y ago
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 the web.
Here is what worked for me to learn the basics well: I started off with the book 'Scala for the Impatient', the first half of the book is freely available. I then used Scala School as a list of topics and researched on each using Google. StackExchange has some amazing answers that helped me a lot.
Free part of Scala for the Impatient: http://fileadmin.cs.lth.se/scala/scala-impatient.pdf http://fileadmin.cs.lth.se/scala/scala-impatient.pdf
- chuwy 11y agoI agree about painful learning curve for Scala. Problem I think in very divergent community and in different approaches for a every single problem (unlike for example Python or Go): OOP vs FP, Typesafe vs Typelevel, scalaz vs cats, Cake Pattern vs sanity. There's a also a problem that most powerful Scala techniques are there "by accident" [1] and unlikely will (or should) appear in official guides. Also I disagree that "Scala for impatient" is good book for start. It make me feel Scala is dump of random unrelated features, it's very easy to disappoint. However, despite all above I think Scala is definitely worth to invest some time. It made all other learning curves (for languages, techniques, concepts) more flatten. [1] https://meta.plasm.us/posts/2015/07/11/roll-your-own-scala/ https://meta.plasm.us/posts/2015/07/11/roll-your-own-scala/
- squimmy 11y agoI'm aware it's probably not intentional, but you describe Scala as being eclectic, and then immediately criticize Scala For The Impatient for presenting it as eclectic! However, I do feel like you're right. For instance, the section on XML literals probably should have been avoided, since that feature doesn't fit nicely with the rest of the language and most of the time isn't necessary to know.
- argonaut 11y agoI think that's totally consistent. It's bad that Scala is so eclectic. It's also bad that introductory books present Scala as eclectic instead of selecting the "best" subset of Scala to teach.
- bbcbasic 11y ago> It made all other learning curves (for languages, techniques, concepts) more flatten. I find learning Haskell definitely does this and although I can't do the same things in C# a lot of the ideals (immutable state, keeping things separate and simple as possible) not having a complex unpredictable state to manage with lots of 'actors' trying to mangle with it. Haskell has design patterns which are only what in the OO GoF context you couldn't even dream of. The free monad interpreter pattern alone can probably achieve what all of the other patterns do and then a few more light years. It is amazing stuff and to bring a single drop of this greatness back to the mortgage-paying languages is nice to do. Rx anyone?
- saosebastiao 11y agoThe community is the worst part IMO, and it all boils down to the Typesafe vs Typelevel communities. The typelevel crowd want to turn Scala into Haskell whereas the typesafe crowd have always recognized it as an ML dialect first and foremost. The rift pollutes and bloats your dependencies, and causes problems with unexpected behavior and unreadable documentation. Trying to shoehorn libraries into my projects that pollute their code with these new standard libraries with lazy functionality and its accompanying monadic bullshit[1] is a huge thorn in my side. I wish the typelevel crowd would just accept the fact that Scala is an ML language, and adopt Frege instead if they can't handle that. [1] https://existentialtype.wordpress.com/2011/05/01/of-course-ml-has-monads/ https://existentialtype.wordpress.com/2011/05/01/of-course-m...
- the_af 11y agoYou are talking from the point of view of an advanced I-know-about-this-stuff annoyance level. Newbies to Scala, especially those coming from Java, couldn't care less whether it looks more like ML or like Haskell. Both languages would be alien to them. Robert Harper's "Existential Type" blog is hardly aimed at the average programmer. I'm pretty sure this is not the worst part about Scala :)
- acjohnson55 11y agoI find that the Typesafe (Lightbend) and Typelevel communities are more or less moving in the same direction. Using Shapeless, for example, doesn't seem to really conflict with more mundane Scala usage. I'd say that there's more of a contrast with the Scalaz world, where obscure category-theoretic terms and operators are unavaoidable. That said, I've had plenty of success applying Scala at work without bringing in overt category theoretical concepts into my codebases. Scalaz remains very much an opt-in community.
- StreamBright 11y agoThe 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!
- TurboHaskal 11y agoTons of companies make big bucks out of making stuff more complex then selling training and consultancy services. Lightbend is one of them.
- terryf 11y agoI'd say yes. It certainly is hard and I spent the first few months wrestling with the syntax, but when you figure out all the puzzle pieces and they come together, then it suddenly turns very beautiful and terse. The terseness is probably what makes the learning hardest, but there is utility there, because you don't have to focus on the boilerplate, but can see more of the algorithm at once. Also, anything that moves you more towards fp is a good thing, because again, when you start to get it and manage to apply it in the correct way, it is extremely elegant and composable.
- 20andup 11y agoYes as a programmer. No as startup guy. For me, it's like learning to do multiplications instead of just adding and subtracting. You will still get the same answer at the end. For a startup, you don't want to your programmers to learn cause its a heavy investment in terms of time. Adding and subtracting works just fine so they often advocate that route. You definitely get to the end goal, but when it comes to learning new things, you are never certain what the outcome will be.
- davedx 11y agoWe started with Scala when we were a startup. It's worked out very well for us: our orchestration layer in Scala has been maintainable and scaled well as the organisation grew, and the power of Scala has meant each change is small and focused (i.e. doesn't have the verbosity and boilerplate of Java).
- salex89 11y agoThis 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 refactoring and so on. Too be honest, I'm not too advanced, but I kinda like the pace. Word of warning: Java is still my main language at work, but the language choice is not my decision. However, whatever happens with Scala or me in the future, one thing stays, I became a better Java developer because of Scala. Also, the colleagues got interested after looking into some Akka Streaming apps :D .
- argonaut 11y agoBut 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.
- jinst8gmi 11y agoIt'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.
- argonaut 11y agoThat's a pretty bad example. Git is widely considered [1] to be overly complex and difficult to learn compared to something like Mercurial. The advantage Git has is its dominance in terms of adoption/community. Scala does not have juggernaut dominance in programming languahes. [1] I acknowledge this is debatable, but it's an opinion I agree with.
- 11y ago
- Mullefa 11y agoIn this talk https://www.youtube.com/watch?v=_-I_X-k3D8A https://www.youtube.com/watch?v=_-I_X-k3D8A Martin Odersky talks about Scala centre. Coming 2016, it's two purposes are to: 1. organise open source projects around Scala 2. organise and develop online teaching
- 20andup 11y agoI 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 never really got a good hold of it. For me Scala has a little bit more upfront cost to learning (but if you come form Java and C#, it should almost be second nature) but the things you can do with it once you get a hold of it is amazing. Go (for me) on the other hand is very easy to write simple Hello World programs, but if you want to do complex applications, it has much more down payment.
- llomlup 11y agoI 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.
- mclifton 11y agoAgreed on the C# front. Outside of implicits, I feel like there was just the occasional google search to find what the equivalent LINQ method was in Scala. It took a couple of days to get it sorted out in my head, but I was able to jump in with Play Framework very quickly since everything was so similar to MVC/C#.
- hythloday 11y agoI've taught Scala to tens of engineers. The golden path is the Coursera course "Functional Programming Principles in Scala"[1]. It's a pretty comprehensive set of lessons, by the author of the language, of how to tastefully compose the basic elements of Scala to solve interview-sized questions. I really think that Martin Odersky's skill as an educator is a highly underrated part of the success of the language. [1] https://www.coursera.org/course/progfun https://www.coursera.org/course/progfun
- mafribe 11y agoI have asked tens of final year students to learn Scala for their final year projects, and pointed them towards Odersky's Coursera course. All my students liked the course, picked up Scala quickly, really enjoyed programming in Scala afterwards. Once they get it, they typically say something along the lines of "I never want to go back to Java". As an aside, part of why Odersky's course work so well is that it's influenced by SICP (Structure and Interpretation of Computer Programs) by Abelson and Sussman.
- tylerpachal 11y agoIs it possible to see the material even though the course isn't currently running?
- tsotnet 11y agoYes you can see lectures, homeworks, etc. Only you can't submit homeworks for evaluation.
- mathattack 11y agoI'm curious - is the harder part of learning Scala the language itself, or getting one's mind around functional programming itself? (Does having a Scheme/LISP background help?)
- justinhj 11y agoI was a long time hobby level Common Lisp and Clojure programmer when I started learning Scala. Understanding functional programming before coming to Scala definitely made it easier. That said I think Scala has a little extra learning curve because you need to understand some syntax especially around type declarations, and understand how flatmap and map work, not just on lists but on many different kinds of data structure.
- cabalamat 11y agoI'm currently going through the book Functional Programming In Scala, and recommend it.
- argonaut 11y agoI 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 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.
- eatonphil 11y agoIf you have the time and the interest, start with Standard ML. It is one of (or just?) the simplest languages in the ML family (which also include OCaml, Haskell, Scala, etc.). You'll see yourself wanting a number of features you'd expect in a modern language, and end up discovering the motivation and approach behind how Scala or Haskell work. Operator overloading (ad-hoc polymorphism) and modular implicits are two of the ones I come across the most. I have always felt that Haskell and Scala (and OCaml sorta) are way too complicated. However, spending time learning Standard ML and the foundations of this family have been really illuminating - you'll discover how powerful Haskell and Scala really are. For an analogy, you can think of switching to FreeBSD from Linux to get closer to Unix roots so you can understand Linux (the historic decisions and reasons) better. Take a look at the /r/sml wiki [0] if you need help getting started. [0] https://www.reddit.com/r/sml/wiki https://www.reddit.com/r/sml/wiki
- critium 11y agoI've taught scala to several devs as well and I'd like to echo that the course on coursera is absolutely essential. On a separate note, I leared scala and clojure nearly at the same time and I'd say that learning clojure actually helped me grow in scala as well. edit: Reply fail. This was a response to hythloday -----
- deleted 11y ago[deleted]
- mjt0229 11y agoReally? Rust was harder for me to adjust to by far. It seems like a moving target and the documentation I found was still lacking.
- steveklabnik 11y agoI would be interested in hearing about what parts of the docs are a pain for you, if you have the chance.
- kailuowang 11y agoMy advice is that don't expect that you can "learn" Scala in a couple of weeks or months. Instead expect that you can learn enough Scala to get the next task done. If you like it, you might be pretty happy spending a couple years learning it.
- Homunculiheaded 11y agoI think the Scala learning experience is very different depending on whether you're coming from the Java -> Want to use Functional Programming route or the Functional Programmer -> Have to use Java for a project route. As someone with a lot FP experience having to work with some Java libraries, getting started with the "This is more pleasant than Java" style of Scala takes very little time. To the point where the typing it saves you in a week roughly equals the cost of skimming through Scala for the Impatient to get started. Granted the "This is more pleasant than Java" style of Scala is the equivalent of the "C with Classes" style of C++. But as far as getting started learning Scala I've found that it is quicker than most FP languages to just dive in and get things done, refactoring as you learn more idiomatic approaches to problems. For me the big risk for Scala that I've seen is the same as C++: The language is so big and so flexible that you can have two developers write the same programs and get results that are difficult to see as being the same language. And because you can get stuff done without writing idiomatic code it's very easy to stop learning and be quite far from what experienced Scala developers would consider a Scala programmer.