You are previewing Scala in Depth.

Scala in Depth

Cover of Scala in Depth by Foreword by: Martin Odersky... Published by Manning Publications

Chapter 3. Modicum of style—coding conventions


In this chapter
  • The dangers of dragging old coding conventions into Scala
  • Working with end-of-line inference
  • Avoiding dangerous names for variables
  • Ensuring correct behavior with annotations


This chapter presents style suggestions that will help you avoid compiler or runtime errors. Style issues are usually a “holy war” among developers, who each has her own opinions. But there are certain things that Scala allows from a style perspective that can cause logic or runtime issues in your programs. This chapter doesn’t try to proselytize you into whether you should place spaces between parenthesis or what the best number of spaces for indentation is. This chapter merely presents a few styles ...

The best content for your career. Discover unlimited learning on demand for around $1/day.