3 ms·
Dart is a fine language. But I struggle to understand why it exists in the first place, there is nothing in there that is done better in Dart than in other lang
by auggierose 5y ago
Dart is a fine language. But I struggle to understand why it exists in the first place, there is nothing in there that is done better in Dart than in other languages. Yes, Java has some "Enterprise" problems, but the language itself is just like Dart. Really, they could have just used Java, they probably didn't do it for legal / political reasons.
What I like about Swift is its "protocol oriented programming", which is basically pragmatic Haskell type classes. There is just so much done right in Swift, that I have a hard time going back to any language that doesn't have it:
* protocols, integrated with struct/enum/class
* dot-syntax when the context is known (like .blue instead of Color.blue)
* immutable data structures via copy-on-write, nicely integrated into the language
* best integration of optional type (like Int?) I've ever seen in a language
* (optional) named function parameters (in the beginning I was annoyed, but now I am a big fan)
* the way exceptions work
* cheap garbage collection (kinda; ARC is working like garbage collection for most of the code I write)
* great package system
* great IDE (Xcode)
- endtime 5y agoAh, thanks for clarifying. I don't think Dart is quite so similar to Java that it needn't exist, but I understand what you meant better now. I haven't used Swift, and I'm not likely to, but it sounds pretty good.