Feedback sought: Optional Braces

I think we can close the thread now. We have argued all the points, most of them many times over.
The discussions and suggestions were very useful. For leaving out braces after classes we went back and forth between two designs: with and :. I believe both would have been absolutely fine. In the end, : won since it was for most the more appealing choice in practice, and since it generalizes well to supporting optional braces in method calls in future versions of the language after 3.0.

Other things that materialized from these discussions:

  • Clarify the underlying layout meta rules, both as a justification of the current design and as a guideline for further developments
  • The -Yindent-colons option is too restrictive and has to be refined.
  • Layout rules should become stricter over time. Right now, they are intentionally loose to allow as much Scala-2 code as possible, no matter what its indention regime is. But it’s foreseeable to tighten this over time.
  • We have a better doc page and a syntax summary that includes indentation now.

With 575 messages this discussion was really exhausting, but I think things moved forward as a result.

10 Likes