Good book about scala if you have some java&ocaml background

I know how to program in ocaml & java.
But want to learn scala. So I know the basics…
There are many bad books which go into the wrong detail for me.
There are also good once, which one would you advice me.

Obviously I’m not sure what you have tried but how about this project based book? See attached picture.

Basically for people familiar with programming already and aims at applying previous knowledge, how to do and build stuff in scala.

If you are interested in video courses, you may can try as well. I personally like ROCKTHEJVM.

Other than this, you probably don’t need a book but need to just start writing and build a project. Then maybe write down your questions for research and mentoring later as you hit a difficult point.

1 Like

All the books at Books | Scala Documentation are well-regarded.

You say some Scala books are “bad” — it would help us understand what to recommend if you explained that a bit. What books did you already consider and reject, and why?

2 Likes

I personally went through “Programming in Scala 5th Edition” by Odersky, and “Get programming with Scala” by Daniela Sfregola, and they are both great.

The first one is probably more appropriate if you have Java experience, because it compares Scala to Java throughout the book (actually has Java code snippets): “if you are coming from Java, this is probably how you are used to doing it, this is how you do it in Scala…”, but it is more of a reference book. It goes into a lot of detail about the mechanics of the language, but has a lot of optional sections you can skip (it tells you when). It also shows mutation/imperative programming in Scala.

The second one is better, has a lot more practical examples and quizzes sprinkled throughout, but does not go into as much technical detail. No mention of Java. It’s more aimed at beginners, using Scala as their possibly first language, with very short lectures, so it might be a bit too easy for you. It does an amazing job of “teaching monads without teaching monads”, it has the best explanation that I know, for FP newcomers, of map/flatMap/monad transformations without getting theoretical at all. It does have mini-projects, you can look at the code here to get a feel for it. This is my go-to recommendation for any FP/Scala newcomers.

3 Likes

Two notably books are:
-Scala cookbook
-Programming scala scalability