4 ms·
Yes, really. You can write Scala in a very Python-like style, but "_.foo" is much more concise than "lambda x: x.foo", and class declarations are much more conc
by lmm 10y ago
Yes, really. You can write Scala in a very Python-like style, but "_.foo" is much more concise than "lambda x: x.foo", and class declarations are much more concise too ("class Foo(x: Int, y: String)" rather than "class Foo(object): def __init__(self, x, y): self.x = x; self.y = y").
Compared to Java, the inherent safety level of the type system is very similar, but since it's much lighter weight you can do a lot more of it; "newtypes" are much more concise, and for/yield makes it possible to treat errors as values in a lightweight way rather than using the second parallel type system that is Java checked exceptions.