Learning Scala Programming

Learn how to write scalable and concurrent programs in Scala, a language that grows with you.
Preview in Mapt

Learning Scala Programming

Vikash Sharma

Learn how to write scalable and concurrent programs in Scala, a language that grows with you.
Mapt Subscription
FREE
$29.99/m after trial
eBook
$18.00
RRP $35.99
Save 49%
Print + eBook
$44.99
RRP $44.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$18.00
$44.99
$29.99 p/m after trial
RRP $35.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


Learning Scala Programming Book Cover
Learning Scala Programming
$ 35.99
$ 18.00
Scala Design Patterns - Second Edition Book Cover
Scala Design Patterns - Second Edition
$ 35.99
$ 18.00
Buy 2 for $35.00
Save $36.98
Add to Cart

Book Details

ISBN 139781788392822
Paperback426 pages

Book Description

Scala is a general-purpose programming language that supports both functional and object-oriented programming paradigms. Due to its concise design and versatility, Scala's applications have been extended to a wide variety of fields such as data science and cluster computing. You will learn to write highly scalable, concurrent, and testable programs to meet everyday software requirements.

We will begin by understanding the language basics, syntax, core data types, literals, variables, and more. From here you will be introduced to data structures with Scala and you will learn to work with higher-order functions. Scala's powerful collections framework will help you get the best out of immutable data structures and utilize them effectively. You will then be introduced to concepts such as pattern matching, case classes, and functional programming features. From here, you will learn to work with Scala's object-oriented features. Going forward, you will learn about asynchronous and reactive programming with Scala, where you will be introduced to the Akka framework. Finally, you will learn the interoperability of Scala and Java.

After reading this book, you'll be well versed with this language and its features, and you will be able to write scalable, concurrent, and reactive programs in Scala.

Table of Contents

Chapter 1: Getting Started with Scala Programming
Introduction to Scala
Scala advantages
Working with Scala
Running our first program
Summary
Chapter 2: Building Blocks of Scala
What is underneath a Scala program?
Vals and vars
Literals
Data types
Type inference
Operators in Scala
Wrapper classes
String Interpolators
Summary
Chapter 3: Shaping our Scala Program
Looping
The for expressions
Recursion
Conditional statements
Pattern matching
Summary
Chapter 4: Giving Meaning to Programs with Functions
Function syntax
Calling a function
Function literals
Evaluation strategies
Partial functions
Summary
Chapter 5: Getting Familiar with Scala Collections
Motivation
Immutable and mutable collections
Hierarchy of collections in Scala
Commonly used collections in Scala
Rich operations performed on collections
Parallel collections in Scala
Converting a Java collection into a Scala collection
Choosing a collection
Collection performance
Summary
Chapter 6: Object-Oriented Scala Basics
Classes
Abstract classes
Objects as singletons
Companion objects
Case classes
Summary
Chapter 7: Next Steps in Object-Oriented Scala
Composition and inheritance
Class inheritance
Default and parameterized constructors
Traits
Traits as mix-ins
Linearization
Packaging and importing
Visibility rules
Sealed traits
Summary
Chapter 8: More on Functions
Function literals
Methods
Functions versus methods
What are closures?
Higher-order functions
Currying
Partially applied functions
Summary
Chapter 9: Using Powerful Functional Constructs
For expressions
Pattern matching
Different ways we can pattern match
Option type
Lazy declaration
Tail call optimization
Combinators
Type parameterization
Summary
Chapter 10: Advanced Functional Programming
Why so serious about types?
Here comes type parameterization
Another way around - generic classes and traits
Type parameter names
Container types
Type erasure
Variance under inheritance
Abstract types
Type bounds
Abstract versus parameterized types
Type-classes
Summary
Chapter 11: Working with Implicits and Exceptions
Exception handling – the old way
Using the Option way
Either left or right
Implicits - what and why
Implicit parameters
The implicitly method
Implicit conversions
Looking for implicits
Type-classes ahead!
Summary
Chapter 12: Introduction to Akka
Why do we care about Akka?
What's up with the Actor Model?
Understanding the Actor system
Props
Actor references and paths
Selecting existing actorRefs via actorSelection
How the Actor life cycle works
Hello world in Akka
Writing our first Actor
The tell versus ask versus forward method
Stopping Actors
The preStart and postStop hooks
Actor communication via messages and its semantics
Supervising fault in our actors
OneForOne versus AllForOne strategy
Default supervision strategy
Applying the supervision strategy
Testing actors
Summary
Chapter 13: Concurrent Programming in Scala
Concurrent programming
Building blocks of concurrency
Asynchronous programming
Parallel collections
Summary
Chapter 14: Programming with Reactive Extensions
Reactive programming
Reactive extensions
React to RxScala
Summary
Chapter 15: Testing in Scala
The why and what of TDD
ScalaTest
ScalaMock – a native library to mock objects
Summary

What You Will Learn

  • Get to know the reasons for choosing Scala: its use and the advantages it provides over other languages
  • Bring together functional and object-oriented programming constructs to make a manageable application
  • Master basic to advanced Scala constructs
  • Test your applications using advanced testing methodologies such as TDD
  • Select preferred language constructs from the wide variety of constructs provided by Scala
  • Make the transition from the object-oriented paradigm to the functional programming paradigm
  • Write clean, concise, and powerful code with a functional mindset
  • Create concurrent, scalable, and reactive applications utilizing the advantages of Scala

Authors

Table of Contents

Chapter 1: Getting Started with Scala Programming
Introduction to Scala
Scala advantages
Working with Scala
Running our first program
Summary
Chapter 2: Building Blocks of Scala
What is underneath a Scala program?
Vals and vars
Literals
Data types
Type inference
Operators in Scala
Wrapper classes
String Interpolators
Summary
Chapter 3: Shaping our Scala Program
Looping
The for expressions
Recursion
Conditional statements
Pattern matching
Summary
Chapter 4: Giving Meaning to Programs with Functions
Function syntax
Calling a function
Function literals
Evaluation strategies
Partial functions
Summary
Chapter 5: Getting Familiar with Scala Collections
Motivation
Immutable and mutable collections
Hierarchy of collections in Scala
Commonly used collections in Scala
Rich operations performed on collections
Parallel collections in Scala
Converting a Java collection into a Scala collection
Choosing a collection
Collection performance
Summary
Chapter 6: Object-Oriented Scala Basics
Classes
Abstract classes
Objects as singletons
Companion objects
Case classes
Summary
Chapter 7: Next Steps in Object-Oriented Scala
Composition and inheritance
Class inheritance
Default and parameterized constructors
Traits
Traits as mix-ins
Linearization
Packaging and importing
Visibility rules
Sealed traits
Summary
Chapter 8: More on Functions
Function literals
Methods
Functions versus methods
What are closures?
Higher-order functions
Currying
Partially applied functions
Summary
Chapter 9: Using Powerful Functional Constructs
For expressions
Pattern matching
Different ways we can pattern match
Option type
Lazy declaration
Tail call optimization
Combinators
Type parameterization
Summary
Chapter 10: Advanced Functional Programming
Why so serious about types?
Here comes type parameterization
Another way around - generic classes and traits
Type parameter names
Container types
Type erasure
Variance under inheritance
Abstract types
Type bounds
Abstract versus parameterized types
Type-classes
Summary
Chapter 11: Working with Implicits and Exceptions
Exception handling – the old way
Using the Option way
Either left or right
Implicits - what and why
Implicit parameters
The implicitly method
Implicit conversions
Looking for implicits
Type-classes ahead!
Summary
Chapter 12: Introduction to Akka
Why do we care about Akka?
What's up with the Actor Model?
Understanding the Actor system
Props
Actor references and paths
Selecting existing actorRefs via actorSelection
How the Actor life cycle works
Hello world in Akka
Writing our first Actor
The tell versus ask versus forward method
Stopping Actors
The preStart and postStop hooks
Actor communication via messages and its semantics
Supervising fault in our actors
OneForOne versus AllForOne strategy
Default supervision strategy
Applying the supervision strategy
Testing actors
Summary
Chapter 13: Concurrent Programming in Scala
Concurrent programming
Building blocks of concurrency
Asynchronous programming
Parallel collections
Summary
Chapter 14: Programming with Reactive Extensions
Reactive programming
Reactive extensions
React to RxScala
Summary
Chapter 15: Testing in Scala
The why and what of TDD
ScalaTest
ScalaMock – a native library to mock objects
Summary

Book Details

ISBN 139781788392822
Paperback426 pages
Read More

Read More Reviews

Recommended for You

Scala Design Patterns - Second Edition Book Cover
Scala Design Patterns - Second Edition
$ 35.99
$ 18.00
Scala Machine Learning Projects Book Cover
Scala Machine Learning Projects
$ 35.99
$ 18.00
Mastering iOS 11 Programming - Second Edition Book Cover
Mastering iOS 11 Programming - Second Edition
$ 35.99
$ 18.00
Xcode 4 iOS Development Beginner's Guide Book Cover
Xcode 4 iOS Development Beginner's Guide
$ 29.99
$ 15.00
Mastering Swift 4 - Fourth Edition Book Cover
Mastering Swift 4 - Fourth Edition
$ 35.99
$ 18.00
Learn Scala Programming Language From Scratch [Video] Book Cover
Learn Scala Programming Language From Scratch [Video]
$ 98.99
$ 19.80