News for hackers. Stuff that matters.
Re:Scala 3.0 by Barrin92 on Friday May 14, 2021 @05:02AM (#27152270)
Always wanted to look into Scala but it seemed very intimidating. Is there a good intermediate 'How to' for Scala 3 anyone can recommend?
Re:Scala 3.0 by hocuspocus on Friday May 14, 2021 @05:13AM (#27152327)
In 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-sca...

- https://www.scala-exercises.org (at least the part on the standard library).

- 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.

Re:Scala 3.0 by Milner08 on Friday May 14, 2021 @05:39AM (#27152483)
The 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/. Its basically a companion to the Haskell book 'Learn you a haskell' (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).

Re:Scala 3.0 by lmm on Friday May 14, 2021 @05:13AM (#27152330)
If 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.
Re:Scala 3.0 by valenterry on Friday May 14, 2021 @05:55AM (#27152567)
One 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.

Re:Scala 3.0 by kjaer on Friday May 14, 2021 @06:20AM (#27152699)
I 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 [2]: https://www.youtube.com/watch?v=j-H6LSv2z_8&list=PLTx-VKTe8y...

Re:Scala 3.0 by kag0 on Friday May 14, 2021 @08:40PM (#27161171)
Re:Scala 3.0 by pas on Saturday May 15, 2021 @09:18AM (#27164931)
I'm recommending looking into ZIO too. It has the most useful effect system ("monad") currently in the Scala ecosystem.
Re:Scala 3.0 by _Wintermute on Friday May 14, 2021 @11:36AM (#27155381)
I have the same issue, but that all the tutorials assume familiarity with Java.
Re:Scala 3.0 by hocuspocus on Friday May 14, 2021 @11:50AM (#27155539)
I 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.