Post by kc// Dart
final Point p = new Point(0,0);
// Swift
let p = Point(0,0)
One of these looks succinct and modern. The other 1995.
This is really cheap. This is how javascript kiddies compare their
languages. We, grownups, at least look at language features. For example,
here are some things that Swift has:
- extensions
- nullable/non-nullable types with null-safe calls
- pattern matching
- tuples
- enums (though they look a bit strange, serving 2 or 3 different
purposes at once)
- ability to create a new instance of generic type
- structures ... I mean, value types (yea, sure, scalar replacement...)
- *understandable* function parameters (optional params, named params,
variadic params, passing by reference)
- arbitrary parameters for [] and []=
On the other hand, Dart has:
- arbitrary-precision ints
- mixins
- isolates (OK, this one will be an advantage once they start to make
sense, which is barely starting to happen)
- library-based privacy (heck, I don't remember seeing anything about
privacy in Swift language guide, am I blind?)
- implicitly defined interfaces
- no operator overloading (yes, I consider the inability to define
operator +<+>+ an advantage!)
- automatic memory handling via GC (ARC gives you deterministic
finalization, which is nice, but the way they solve the cycle problem looks
really subpar)
- consistent handling of method parameters (in Swift, by default, no
parameter is named for functions, all but the 1st are named for methods and
all are named for initializers; it makes sense given historical context,
but is still fairly arbitrary and can easily be very confusing to people)
Note that this is based on a pretty quick glance over the Swift language
guide, zero experience in actually using the language, so I might have
easily missed or misunderstood a lot of stuff. (Not that you didn't.)
LT
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
To unsubscribe from this group and stop receiving emails from it, send an email to misc+unsubscribe-dYxm/***@public.gmane.org