Table of Contents

 

Copyright

Brief Table of Contents

Table of Contents

Foreword

Preface

Acknowledgments

About this Book

About the Cover Illustration

Chapter 1. Scala—a blended language

1.1. Functional programming meets object orientation

1.1.1. Discovering existing functional concepts

1.1.2. Examining functional concepts in Google Collections

1.2. Static typing and expressiveness

1.2.1. Changing sides

1.2.2. Type inference

1.2.3. Dropping verbose syntax

1.2.4. Implicits are an old concept

1.2.5. Using Scala’s implicit keyword

1.3. Transparently working with the JVM

1.3.1. Java in Scala

1.3.2. Scala in Java

1.3.3. The benefits of a JVM

1.4. Summary

Chapter 2. The core rules

2.1. Learn to use the Read Eval Print Loop (REPL)

2.1.1. Experiment-driven development

2.1.2. Working around eager parsing

2.1.3. Inexpressible language features

2.2. Think in expressions

2.2.1. Don’t use return

2.2.2. Mutability

2.3. Prefer immutability

2.3.1. Object equality

2.3.2. Concurrency

2.4. Use None instead of null

2.4.1. Advanced Option techniques

2.5. Polymorphic equality

2.5.1. Example: A timeline library

2.5.2. Polymorphic equals implementation

2.6. Summary

Chapter 3. Modicum of style—coding conventions

3.1. Avoid coding conventions from other languages

3.1.1. The block debacle

3.2. Dangling operators and parenthetical expressions

3.3. Use meaningful variable names

3.3.1. Avoid $ in names

3.3.2. Working with named and default parameters