"The book is written in an accessible style, with numerous examples, and is suitable for a wide range of audiences from novices, just starting to learn how to handle a programming language, to experts trying to get to grips with Scala. The continuous parallel between Scala and Java is used to highlight an interesting angle in both languages, so, technically, the book can be used as a guide to both Java and Scala." (Irina Ioana Mohorianu, zbMATH 1382.68005, 2018)
I. Scala Tour
1. The Scala Language
2. Installing Scala
3. Some Basic Syntax
4. Scala’s Class Hierarchy
5. ScalaDoc
6. Language Features
II. Key Syntactical Differences
7. Classes and Fields
8. Classes and Objects
9. Classes and Functions
10. Inheritance
11. Control Structures
12. Generics
III. Beyond Java to Scala
13. Faking Function Calls
14. Faking Language Constructs
15. Pattern Matching
16. Map and FlatMap
17. Monads
18. For Comprehensions
IV. Adopting Scala in Java Teams
19. Adopting Scala
20. What to Expect
21. Tips
22. Convert Your Codebase
23. Manage Your Codebase
Appendix A. Code Listings
Appendix B. Syntax Cheat Sheet
Toby Weston is an independent consultant based in London. He specializes in agile enablement, training and modern software development. For more, visit www-dot-baddotrobot-dot-com.
Master the fundamentals of Scala and understand its emphasis on functional programming that sets it apart from Java. This book will help you translate what you already know in Java to Scala to start your functional programming journey. Learn Scala is split into four parts: a tour of Scala, a comparison between Java and Scala, Scala-specific features and functional programming idioms, and finally a discussion about adopting Scala in existing Java teams and legacy projects.
After reading and using this tutorial, you'll come away with the skills in Scala to kick-start your productivity with this growing popular language.
You will:
Tour Scala and learn the basic syntax, constructs, and how to use the REPL
Translate Java syntax that you already know into Scala
Learn what Scala offers over and above Java
Become familiar with functional programming concepts and idioms
Gain tips and advice useful when transitioning existing Java projects to Scala