Generally, I think the idea of braceless syntax has a lot of potential to clean up the language, so I support the exploration.
However, I think the current implementation needs more work. Having multiple ways to open a new block, namely :, with, do, a newline, or then, is very inconsistent when compared with the status quo of using { everywhere. When I code, I need to think about my problem space, not syntactic rules. Muscle memory is really important here, and that inconsistency would destroy it. The fact that two of those block-openers are overloads of existing syntax (with and :) makes it even worse. I know that these changes are categorized as different features, but it seems they are not independent from each other given the discussions in this thread and elsewhere.
I think that it was a mistake to write books, record MOOCs, etc. based on an unfinished syntax that was subject to change. But the only way to make that mistake worse would be to double down and use those sunk costs as an excuse to force an inconsistent syntax on the language.
There are, then, two choices for going forward:
-
Quickly resolve the inconsistency above, in time to ship. Personally, I like the idea of doing away with :, with, do and then completely, although I recognize that it’s probably significant work to do so, and I’m somewhat ignorant of the implications.
-
Admit that braceless syntax needs more time to bake, and that shipping Scala 3 doesn’t require it. Make the braceless syntax an experimental feature, turned off by default. Continue to iterate on it, and include it in a later release.
Both options require some adjustment to documentation, materials, etc. I know that @odersky already said 2 is off the table due to the large amount of work to rewrite various docs, but all the adjustments proposed here require rewriting/re-recording anyway. Drawing a line between existing-brace-syntax and adjusted-braceless-syntax seems somewhat arbitrary.
Regardless of my specific syntactic concerns, I think that one thing that is indisputable is that this is a highly controversial subject in the community. I am concerned that it will lead to two camps of Scala 3 devs: those writing braces and those not. Given that a major language version with significant other changes already has the potential to split the community somewhat, I think that creating a third group would be a mistake. This is another argument for option 2 above.
Thanks for the opportunity to provide feedback, and I’m looking forward to Scala 3!