The Many Choices in Scala

A Scala programmer has to do many more choices when programming than a Java programmer. I believe that this is one of the sources to the feeling that Scala is complex and that we can mitigate the burden of choice by making the choices explicit.

Odersky’s Selection of Choices (from Scala with Style)

In the presentation Scala with Style, Odersky presents six different choices a Scala programmer often has do:

  1. Infix vs ”.”
  2. Alphabetic vs Symbolic
  3. Loop, recursion or combinators?
  4. Procedures or ”=”
  5. Private vs nested
  6. Pattern matching vs dynamic dispatch

(Follow the linked header for more information about each choice.)

A Couple More

I have identified a couple of others:

  1. Should I promote this to an extractor object?
  2. Should I rename this type on import?
  3. Should I give this import local scope or file scope?
  4. Should I use an abstract type or a type parameter?
  5. Should I introduce a type alias for this type?