Scala from Scratch: Exploration
Scala from Scratch: Exploration
$14.99
Minimum price
$19.99
Suggested price
Scala from Scratch: Exploration

This book is 100% complete

Completed on 2020-01-10

About the Book

Scala from Scratch: Exploration is the first in a series of two books that teach you the Scala programming language. Readers that have some experience with an object-oriented or imperative language, like Java, Ruby, or Python, will get a comprehensive overview of what Scala brings to the table. The goal is to get you excited about Scala and give you a strong foundation for writing your first applications and continuing your journey. By the end of the book, you will have a good idea of what it's like to work with Scala, and you will have written a small, but complete command-line application based on a Functional Core, Imperative Shell architecture.

In this book you will learn about functional and object-oriented aspects of Scala. You will learn how to write expressive, intent-revealing code using pattern matching, functional sequence processing and for comprehensions, and how to design data types that enforce their business invariants in a functional way, without throwing exceptions. You will get a first glimpse at Scala's powerful type system and how to abstract over concrete types, and you will learn all there is to know about working with Option, Scala's approach at avoiding the million dollar mistake of null references.

If you are excited and want to continue your journey, you will be able to do with the upcoming second book in the series, Scala from Scratch: Understanding, which will go even deeper into the topics explored in this book and will discuss advanced language features and patterns.

Reviews

Have you read the book? I would be very grateful for reviews and ratings at the book's Goodreads page.

About the Author

Daniel Westheide
Daniel Westheide

Daniel Westheide is a software engineer living in Berlin, Germany. He is a senior consultant at INNOQ and co-organizer of ScalaBridge Berlin, the Berlin chapter of the ScalaBridge organization. He cares about empathy and inclusivity, and about the ethical, social, and ecological consequences of his work.

On his website, he discusses functional programming, architecture, as well as anything related to the software development process. He is not only interested in programming languages, but also a human language enthusiast. Moreover, he is passionate about specialty coffee, social science fiction, and tabletop roleplaying games.

About the Contributors

Ann-Marie Rechter
Ann-Marie Rechter

Freelance Illustrator and Designer

Ann-Marie is responsible for the cover illustration. She is a freelance illustrator and designer from Hamburg, Germany.

She regularly posts some of her artwork as illumarie_art on Instagram.

Table of Contents

  • Credits
  • Preface
  • 1. With a REPL yell
    • 1.1 What’s a REPL?
    • 1.2 Install fest
    • 1.3 Doing the math
    • 1.4 Greetings from Mr. Boole
    • 1.5 Values and variables
    • 1.6 The thin line between compile time and runtime
    • 1.7 Local type inference
    • 1.8 Calling methods
    • 1.9 Summary
  • 2. Scala, the functional language
    • 2.1 The purely functional way
    • 2.2 More about writing functions
    • 2.3 If-expressions
    • 2.4 Functions as values
    • 2.5 Escaping the loop
    • 2.6 Summary
  • 3. Scala, the object-oriented language
    • 3.1 Classes and objects
    • 3.2 Singleton objects
    • 3.3 Visibility modifiers
    • 3.4 Traits
    • 3.5 Everything is an object
    • 3.6 Am I equal? Yes I am!
    • 3.7 Summary
  • 4. Scala, the expressive language
    • 4.1 Named and default arguments
    • 4.2 A first glance at pattern matching
    • 4.3 Case classes
    • 4.4 Tuples
    • 4.5 Processing sequences, the functional way
    • 4.6 More sugar with for comprehensions
    • 4.7 Type aliases
    • 4.8 No strings attached
    • 4.9 Summary
  • 5. Tools for modular code
    • 5.1 Inner classes, objects, and traits
    • 5.2 Packages
    • 5.3 Imports
    • 5.4 Package-level visibility modifiers
    • 5.5 Package objects
    • 5.6 Summary
  • 6. Bringing value to your classes
    • 6.1 Value classes
    • 6.2 Extension methods
    • 6.3 Summary
  • 7. Scala type system 101
    • 7.1 Type constructors
    • 7.2 Polymorphic methods
    • 7.3 Polymorphic extension methods
    • 7.4 Summary
  • 8. The strict brown fox jumps over the lazy dog
    • 8.1 By-name parameters
    • 8.2 Lazy values
    • 8.3 Summary
  • 9. Know your options
    • 9.1 The basic idea
    • 9.2 Creating an option
    • 9.3 Working with optional values
    • 9.4 Options are collections
    • 9.5 For comprehensions
    • 9.6 Chaining options
    • 9.7 Purely functional data types
    • 9.8 Option in the standard library
    • 9.9 Summary
  • 10. Putting it all together
    • 10.1 Talking to the product owner
    • 10.2 Architectural decisions
    • 10.3 Setting up the project
    • 10.4 The functional core
    • 10.5 The imperative shell
    • 10.6 Packaging the application
    • 10.7 Summary
  • 11. Downtime
    • 11.1 Summary
    • 11.2 The road ahead
    • 11.3 Taking action
  • Notes

Authors have earned$8,414,970writing, publishing and selling on Leanpub,
earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub