Let's drop postfix operators

I think there’s a better solution to postfix operators, which would be to introduce some limited measure of indentation sensitivity to Scala’s syntax.

val x = foo bar
baz
// means:
val x = foo bar;
baz

val x = foo bar
  baz
// means:
val x = foo bar baz

I think this will avoid confusing newcomers, since it’s a natural convention that most people already follow – that a non-indented line does not normally continue the expression above.

The same principle could be used to get rid of the fact that removing a comment in some places can break Scala code, which many people seem to find inexcusable.

foo.bar
{ ... }
// means:
foo.bar;
{ ... }

foo.bar
  { ... }
// means:
foo.bar { ... }

// same as:

foo.bar
// comment
  { ... }

// same as:

foo.bar

  { ... }
5 Likes