Should I start learning Kotlin or go with Flutter?

Not sure what a link to the limited syntax of Dart lambdas is contributing to the conversation. Yes they both have lambdas, but Dart lambdas do not have the syntax niceties of Kotlin lambdas. Dart does not have (correct me if I an wrong on any of these):

  • implicit parameter using it
  • the ability to put the lambda outside the parentheses and drop the parentheses
  • destructuring lambdas
  • the inability to use extension methods as method references

So for example if I had a collection of integers and wanted to filter to only those greater than 5 I would say one of these two options:

myInts.where((i) => i > 5)
myInts.where((i) { return i > 5 })

For Kotlin we do not have those distinctions as its lambdas are always in braces and the return is not needed as the last expression is the return value so the equivalent of those in Kotlin is:

myInts.filter({ i -> i > 5})

But Kotlin also lets you say:

myInts.filter { i -> i > 5 }
myInts.filter { it > 5 }

Is this enough to say that you should not use Flutter? No. Is it annoying? Yes

1 Like