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 ...

Get Scala in Depth now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.