Hacker News new | ask | show | jobs
by necrobrit 3157 days ago
It's both... simultaneously.

The "feature set" really is smaller than Java or Kotlin (especially if you count in terms of "keywords as features" and ignore things included for Java compatibility).

The flexibility though can be genuinely overwhelming (the name, scala[bility], refers to scalability of the syntax, not performance). Both in terms of the syntax flexibility , e.g. where curly braces are optional vs not or different ways of writing lambdas, and powerful/flexible features like implicit. However there are very rarely special cases to these, it's all very consistent once you know the rules.

Even the infamous underscore is "logically" consistent in it's use, it's just a placeholder in both contexts you typically see it used (context of variables and context of types).

Even my go-to example of a special case in scala, vararg unpacking:

`foo(myArgs: _*)`

Despite being a special case actually reads kind of consistently.. it reads like a type ascription[1] asking for myArgs to be treated as a varargs of whattever type. So consistent with other "type context" usages of underscore despite otherwise being weird.

[1] https://docs.scala-lang.org/style/types.html#ascription

1 comments

> refers to scalability of the syntax

And the flexibility of the type system and the advanced type inference.