Why learn Scala? You don’t need to be a data scientist or distributed computing expert to appreciate this object-oriented functional programming language. This practical book provides a comprehensive yet approachable introduction to the language, complete with syntax diagrams, examples, and exercises. You’ll start with Scala's core types and syntax before diving into higher-order functions and immutable data structures.
Author Jason Swartz demonstrates why Scala’s concise and expressive syntax make it an ideal language for Ruby or Python developers who want to improve their craft, while its type safety and performance ensures that it’s stable and fast enough for any application.
Learn about the core data types, literals, values, and variables
Discover how to think and write in expressions, the foundation for Scala's syntax
Write higher-order functions that accept or return other functions
Become familiar with immutable data structures and easily transform them with type-safe and declarative operations
Create custom infix operators to simplify existing operations or even to start your own domain-specific language
Build classes that compose one or more traits for full reusability, or create new functionality by mixing them in at instantiation
Chapter 1Getting Started with the Scalable Language
Using the Scala REPL
Chapter 2Working with Data: Literals, Values, Variables, and Types
Chapter 3Expressions and Conditionals
If..Else Expression Blocks
Functions with Empty Parentheses
Function Invocation with Expression Blocks
Calling Functions with Named Parameters
Parameters with Default Values
Methods and Operators
Writing Readable Functions
Chapter 5First-Class Functions
Function Types and Values
Partially Applied Functions and Currying
Invoking Higher-Order Functions with Function Literal Blocks
Jason is a Software Engineer in the San Francisco Bay Area, developing Scala applications at Loyal3 and Netflix. Before making the switch to functional programming he managed the developer docs and support team at eBay, wrote advertising and merchandising platforms in Java and built tools and UI prototypes at Apple.
The animal on the cover of Learning Scala is the American Ostrich, or the greater rhea (Rhea americana), a tall, flightless bird found in eastern South America. Known locally as the ñandú, it is one of the two birds that comprise the rhea species, along with its smaller, more uncommon counterpart, the lesser rhea (rhea pennata).
Endemic to Argentina, Bolivia, Brazil, Paraguay, and Uruguay, the greater rhea inhabits open areas with tall vegetation, such as grasslands, savanna, and grassy wetlands. Curiously, a small nonindigenous population also exists in rural northwest Germany, established in 2000 after several escaped from a farm. These birds have prospered in the wild, defying all expectations.
While markedly similar to the African ostrich, the greater rhea has three toes rather than two and is about half the size; adult rheas stand at about five feet tall and weigh between 44 and 60 pounds. Its fluffy plumage is gray, with dark patches on the crown, neck, and upper back. The bird’s long, powerful legs make it a fast runner, capable of reaching speeds of over 35 miles per hour. Its large wings, which help maintain balance while running, are also flaunted in elaborate courtship displays.
The American Ostrich typically nests near water. Rheas are polygamous, and so each male may mate with up to twelve females during the spring and summer, its breeding season. Males become extremely territorial during this period, behaving aggressively toward one another. After mating, the female will deposit her eggs into the nest and often move on to a new partner. The male alone will incubate the eggs of all of its mates, typically in the same nest. Later, he will forcefully guard and care for the young.
Apart from breeding rituals, they are communal birds, amassing flocks of 10 to 100 and even mixing with other large animals, such as deer. The greater rhea enjoys a diet of plants, seeds, and fruit but also has been known to consume insects, small rodents, reptiles, and small birds. It also swallows pebbles to aid digestion.
If you are an experienced software engineer, programmer or developer but don't know Scala and are looking for a book that will take you from being a Scala novice to a Scala advanced beginner, this book is a good choice.
The book gives you a tour of Scala features, and introduces you to many Scala concepts you will use in your day-to-day programming.
You won't be a Scala master after reading this book. But you will on your way towards Scala competency.
Bottom Line Yes, I would recommend this to a friend