Book description
Get up to speed on Scala--the JVM, JavaScript, and natively compiled language that offers all the benefits of functional programming, a modern object model, and an advanced type system. Packed with code examples, this comprehensive book shows you how to be productive with the language and ecosystem right away. You'll learn why Scala is ideal for building today's highly scalable, data-centric applications, while maximizing developer productivity.
While Java remains popular and Kotlin has become popular, Scala hasn't been sitting still. This third edition covers the new features in Scala 3.0 with updates throughout the book. Programming Scala is ideal for beginning to advanced developers who want a complete understanding of Scala's design philosophy and features with a thoroughly practical focus.
- Program faster with Scala's succinct and flexible syntax
- Dive into basic and advanced functional programming techniques
- Build killer big data and distributed apps using Scala's functional combinators and tools like Spark and Akka
- Create concise solutions to challenging design problems with the sophisticated type system, mixin composition with traits, pattern matching, and more
Publisher resources
Table of contents
- Foreword
-
Preface
- Welcome to Programming Scala, Third Edition
- Welcome to Programming Scala, Second Edition
- Welcome to Programming Scala, First Edition
- Conventions Used in This Book
- Using Code Examples
- O’Reilly Online Learning
- How to Contact Us
- Acknowledgments for the Third Edition
- Acknowledgments for the Second Edition
- Acknowledgments for the First Edition
- 1. Zero to Sixty: Introducing Scala
-
2. Type Less, Do More
- New Scala 3 Syntax—Optional Braces
- Semicolons
- Variable Declarations
- Ranges
- Partial Functions
- Method Declarations
- Inferring Type Information
- Repeated Parameter Lists
- Language Keywords
- Literal Values
- Tuples
- Option, Some, and None: Avoiding Nulls
- Sealed Class Hierarchies and Enumerations
- Organizing Code in Files and Namespaces
- Importing Types and Their Members
- Parameterized Types Versus Abstract Type Members
- Recap and What’s Next
-
3. Rounding Out the Basics
- Defining Operators
- Allowed Characters in Identifiers
- Methods with Empty Parameter Lists
- Operator Precedence Rules
- Enumerations and Algebraic Data Types
- Interpolated Strings
- Scala Conditional Expressions
- Conditional and Comparison Operators
- for Comprehensions
- Scala while Loops
- Using try, catch, and finally Clauses
- Call by Name, Call by Value
- Lazy Values
- Traits: Interfaces and Mixins in Scala
- When new Is Optional
- Recap and What’s Next
-
4. Pattern Matching
- Safer Pattern Matching with Matchable
- Values, Variables, and Types in Matches
- Matching on Sequences
- Pattern Matching on Repeated Parameters
- Matching on Tuples
- Guards in Case Clauses
- Matching on Case Classes and Enums
- Matching on Regular Expressions
- Matching on Interpolated Strings
- Sealed Hierarchies and Exhaustive Matches
- Chaining Match Expressions
- Pattern Matching Outside Match Expressions
- Problems in Pattern Bindings
- Pattern Matching as Filtering in for Comprehensions
- Pattern Matching and Erasure
- Extractors
- Recap and What’s Next
- 5. Abstracting Over Context: Type Classes and Extension Methods
- 6. Abstracting Over Context: Using Clauses
-
7. Functional Programming in Scala
- What Is Functional Programming?
- Functional Programming in Scala
- Recursion
- Tail Calls and Tail-Call Optimization
- Partially Applied Functions Versus Partial Functions
- Currying and Uncurrying Functions
- Tupled and Untupled Functions
- Partial Functions Versus Functions Returning Options
- Functional Data Structures
- Traversing, Mapping, Filtering, Folding, and Reducing
- Combinators: Software’s Best Component Abstractions
- What About Making Copies?
- Recap and What’s Next
- 8. for Comprehensions in Depth
- 9. Object-Oriented Programming in Scala
- 10. Traits
- 11. Variance Behavior and Equality
- 12. Instance Initialization and Method Resolution
- 13. The Scala Type Hierarchy
- 14. The Scala Collections Library
- 15. Visibility Rules
- 16. Scala’s Type System, Part I
-
17. Scala’s Type System, Part II
- Match Types
- Dependently Typed Methods
- Dependent Method and Dependent Function Types
- Dependent Typing
- Path-Dependent Types
- Self-Type Declarations
- Type Projections
- More on Singleton Types
- Self-Recursive Types: F-Bounded Polymorphism
- Higher-Kinded Types
- Type Lambdas
- Polymorphic Functions
- Type Wildcard Versus Placeholder
- Recap and What’s Next
- 18. Advanced Functional Programming
- 19. Tools for Concurrency
- 20. Dynamic Invocation in Scala
- 21. Domain-Specific Languages in Scala
- 22. Scala Tools and Libraries
- 23. Application Design
- 24. Metaprogramming: Macros and Reflection
- A. Significant Indentation Versus Braces Syntax
- Bibliography
- Index
Product information
- Title: Programming Scala, 3rd Edition
- Author(s):
- Release date: May 2021
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781492077893
You might also like
book
Programming Scala, 2nd Edition
Get up to speed on Scala, the JVM language that offers all the benefits of a …
book
Functional Programming in Scala, Second Edition
This international bestseller has been revised with new exercises, annotations, and full coverage of Scala 3. …
book
Scala for the Impatient, 3rd Edition
Scala 3--A Clear, Concise Guide Scala 3 is concise, consistent, flexible, robust, and efficient, but there's …
book
Scala Cookbook, 2nd Edition
Save time and trouble building object-oriented, functional, and concurrent applications with Scala. The latest edition of …