Preface

When you start getting into a new programming language, much is initially confusing simply due to lack of knowledge of the language. As your experience and ability to reason about the language grows, head-scratching moments related purely to the language tend to be replaced by system-level problems such as dependency conflicts or hard-to-reproduce race conditions.

One of things we really liked about Josh Bloch and Neal Gafter's Java Puzzlers is that it allowed us to reengage with Java outside the context of deadlines and day jobs. The puzzlers not only triggered our problem-solving itch. They helped us correct and deepen our understanding of the language.

Soon after we started learning Scala, we thought it would be really useful to collect a similar set of puzzlers—one, in the spirit of the times, built and maintained by the community. Thus, scalapuzzlers.com was born.

Encouraged by the positive feedback we received, we decided to collect and expand the puzzlers into this book. Our goal has been to explain the puzzlers' behavior in much greater detail and discuss potential implications and possible workarounds. We have strived to treat each puzzler as an opportunity to showcase an unusual part of the language, or highlight aspects of a common language feature that are not so well-known.

Researching and explaining each of the puzzlers in detail has been a lot of fun and a great learning experience. We hope you'll get as much out of this book, both in terms of knowledge and of enjoyment, as we have.

And lastly, if you come across a puzzling piece of Scala code, please submit it to us at scalapuzzlers.com. We'd love to have you join the puzzler community!

Andrew Phillips, Nermin Šerifović
Boston, Massachusetts
May 28, 2014

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.148.113.229