|
|
|
|
|
by frowaway001
4393 days ago
|
|
Well, comparing with Java is aiming a bit low, isn't it? Compare Dart's "shorter alternative" of a bog-standard class ... // Shorter alternative
class Person {
String name;
// parameters prefixed by 'this.' will assign to
// instance variables automatically
Person(this.name);
}
... with something more modern: class Person(val name: String) // Done.
|
|
Another thing I like about Dart is that the possible variations on the constructors fall into place, consistently:
No constructor args:
Optional constructor args: Super call: The short Scala form may do that as well for all I know,