Re:Flutter: the good, the bad and the ugly
by marcobellinaso on Friday November 23, 2018 @11:27AM
(#18517363)
It's a good language though, and if you have experience with C#/Swift/Kotlin/Java etc...you'll be productive from day 1...there's not really much to learn, I wouldn't call it a problem.
[ Parent
| on HN ]
Re:Flutter: the good, the bad and the ugly
by cwyers on Friday November 23, 2018 @01:49PM
(#18518193)
My concern about Dart wouldn't so much be language quality, it would be the ecosystem. I know if I go out there and do a project in JavaScript or C# (so RN/Xamarin) there's piles of libraries out there. There's documentation. There's Stack Overflow answers and tutorials.
Re:Flutter: the good, the bad and the ugly
by brianpgordon on Friday November 23, 2018 @11:53AM
(#18517514)
Did you just say that Dart is a good language? You're aware of the memes about Dart's type system being completely broken by design right?
https://www.dartlang.org/faq#q-why-are-generics-covariant
Of course this is from the company that brought us interface{} and people seem to be OK with that...
Re:Flutter: the good, the bad and the ugly
by skybrian on Friday November 23, 2018 @12:42PM
(#18517842)
Flaws in the type system just aren't that important to most people. Consider the popularity of Typescript, which is unsound.
Re:Flutter: the good, the bad and the ugly
by kiriakasis on Friday November 23, 2018 @04:53PM
(#18519111)
I gather that you would prefer invariant generics. I know a bit about type systems but very little about subtyping so I would really enjoy some information :)
Why are covariant generics bad? (also just a link is fine)
Re:Flutter: the good, the bad and the ugly
by brianpgordon on Sunday November 25, 2018 @02:02AM
(#18525762)
Invariant generics would at least let you rely on the type system doing its job correctly. But even better would be to annotate each type parameter as covariant, contravariant, or invariant - this is what Scala and C# and probably a bunch of other languages do.
As an example, here's approximately how the Function trait is defined in Scala. The square brackets indicate type parameters (like angle brackets in Java), the - indicates covariance, and the + indicates contravariance.
trait Function1[-T, +R] {
def apply(arg1: T): R
}