4 ms·
Always wanted to look into Scala but it seemed very intimidating. Is there a good intermediate 'How to' for Scala 3 anyone can recommend?
by Barrin92 6y ago
Always wanted to look into Scala but it seemed very intimidating. Is there a good intermediate 'How to' for Scala 3 anyone can recommend?
- hocuspocus 6y agoIn no particular order: - If you're at least a little familiar with Java, Scala for the Impatient is pretty good, though a little dated (I think the last edition covers Scala 2.12). - Daniel Westheide's blog: https://danielwestheide.com/books/the-neophytes-guide-to-scala/ https://danielwestheide.com/books/the-neophytes-guide-to-sca... - https://www.scala-exercises.org https://www.scala-exercises.org (at least the part on the standard library). - https://www.handsonscala.com https://www.handsonscala.com Note: Scala 3 introduces quite a bit of new syntax that is specifically designed to make intimidating features less so. But at the beginner/intermediate level it won't matter too much, for instance if you learn how to implement typeclasses the old way, you'll easily understand the new syntax. Also the Scala Center has committed to providing a lot of training material along with the Scala 3 release.
- lmm 6y agoIf you know Java then you can start by writing very Java-like code using the same libraries you would in Java - there are a lot of intimidating functional techniques available but you don't have to use them from day 1 (indeed I'd say you probably shouldn't use them until you understand why you would want to). IMO you're much better off picking a small corner of a JVM project (e.g. maybe a migration tool or a couple of tests) and using a little Scala in practice, rather than trying to learn it all to start with.
- Milner08 6y agoThe thing with Scala is it depends on the pattern you want to use. I am a big advocate of it, and the function pattern being used fully with something like Cats or ZIO. However I would not suggest starting there. I would start by playing about with the syntax and writing standard OOP code, as its probably what you're most familiar with. When you want to dive into the power of FP then I recommend http://eed3si9n.com/herding-cats/ http://eed3si9n.com/herding-cats/. Its basically a companion to the Haskell book 'Learn you a haskell' (http://learnyouahaskell.com/ http://learnyouahaskell.com/) that takes the theory coming up in that book and translates it to Scala. I found it the most direct explanation of the different types and theories (Monads, Functors, Applicative, etc).
- valenterry 6y agoOne of the greatest things about Scala is that you can just start if you know Java and be productive. Just write your code like you would in Java, with a slightly different syntax. Then, when you use libraries, you will pick up new concepts step by step. And if you want it so, you can write pure functional code in Scala, similar to Haskell code. If you start with Haskell, you are forced to do pure functional programming. That is much more intimidating and less productive, but also better if you want to force yourself to learn it.
- kjaer 6y agoI think the Scala 3 book [1] might be what you're looking for! There's also an ongoing video series called "Let's talk about Scala 3" by the Scala Center and 47 Degrees [2], which are more in-depth on certain topics, but still quite beginner-friendly. Especially the video on setting up a development environment, and the video on Scala 3's data structures might be good introductions. [1]: https://docs.scala-lang.org/scala3/book/introduction.html https://docs.scala-lang.org/scala3/book/introduction.html [2]: https://www.youtube.com/watch?v=j-H6LSv2z_8&list=PLTx-VKTe8yLxYQfX_eGHCxaTuWvvG28Ml https://www.youtube.com/watch?v=j-H6LSv2z_8&list=PLTx-VKTe8y...
- _Wintermute 6y agoI have the same issue, but that all the tutorials assume familiarity with Java.
- hocuspocus 6y agoI think it's less true nowadays. You have beginner's books (Scala from Scratch, Hands-on Scala) that assume nothing, and more advanced libraries (in the Typelevel or ZIO ecosystems) that provide high-level abstractions for real world projects. You can't entirely avoid being exposed at some point to the JVM inner workings and/or Java libraries that don't necessarily play well, but this doesn't have to happen right away.
- kag0 6y agoYou could check out Scala for JavaScript Developers https://docs.scala-lang.org/scala3/book/scala-for-javascript-devs.html https://docs.scala-lang.org/scala3/book/scala-for-javascript... Python Developers https://docs.scala-lang.org/scala3/book/scala-for-python-devs.html https://docs.scala-lang.org/scala3/book/scala-for-python-dev... Java Developers https://docs.scala-lang.org/scala3/book/scala-for-java-devs.html https://docs.scala-lang.org/scala3/book/scala-for-java-devs.... for a quick introduction
- pas 6y agoI'm recommending looking into ZIO too. It has the most useful effect system ("monad") currently in the Scala ecosystem.