4 ms·
On Scala 3's Optional Braces
- valenterry 4y agoLuckily to the extrem good typesystem and focus on functional programming, a lot of issues with significant whitespace are only annoying but not dangerous in Scala. For instance, in my code base a syntax like if (x > 0) foo(x) bar(x) is always a bug and will essentially never compile. Because if-expressions always return and their result is used. val result = if (x > 0) foo(x) bar(x) This will overall just result in a compile error. Still, it can be annoying especially when using c&p or dealing with legacy code / java code where everything is a string. Therefore I also don't think it's really worth it.
- metadat 4y agoThis variant deserves its own title. Contenders: 1. Scathon 2. Scalon 3. Pyala