Flutter doesn’t need Kotlin (or anything else)

02-26 18:40

It’s not an exaggeration to say that I was super impressed by Flutter the first time I picked it up. Hot Reload, the declarative UI syntax, near (if not actual) native performance and easy access to the underlying OS. Cross-platform is a no-brainer in a mobile development world but I’ve never found a solution that executed it “right”. Flutter felt closer than anything else but one thing didn’t sit right.

Dart. Why Dart!? I thought.

I know this is the common thought process for a lot of people who are coming into Flutter fresh so I figured I’d take a crack at describing my general experience.

I’d had a couple of minor past experiences with Dart, mostly in an attempt to escape Javascript at any cost, but overall it hadn’t made any lasting effect either positively or negatively on me. Now that I was in a situation where I had to use it the thought that “we have Kotlin and Swift and … why Dart!?” kept coming up. Surely one of those other languages would have been way better? There is a talent pool already, why not leverage that? Stuff like that.

As I wrote more and more Flutter it was alongside more Kotlin (mostly) and I kept saying to myself “See? Look at this cool Kotlin thing it’s missing” and getting into a general huff about it. But as I started writing more Dart code, something changed. I started to really appreciate it.

I started to appreciate the simplicity of its asynchronous features, how complete the standard libraries are and features like method cascades that make your code nice to read. I still want(ed) things like Data Classes, Extensions and various language features I’d come to really love, but things started to seem not so bad. Dart 2 development was coming along and feature I know I’d suggested (along with others) were coming to fruition and things started seeming even brighter. “This Dart stuff is pretty neat” I started thinking.

To get a better feel for Dart I decided to try out AngularDart so that I’m not just using Dart in the context of Flutter. Flutter is / can be pretty specific, so the theory here was that may I just have some minor beefs with Flutter and not Dart itself.

The two realizations I made from this experiment is that: #1 — I freaking really like AngularDart, and #2 — It wasn’t Flutter, but getting more exposure to a language in a variety of situations is super important. Dart has a super rich ecosystem to tap into for a variety of situations and it’s worth digging deep. Either way, the end-result was that I felt pretty happy.

Can I say conclusively that its better than Kotlin or Swift? Absolutely not, nor is it worse. Ultimately Dart doesn’t have to be better either.

After all my experiences within the Dart / Flutter ecosystem the obvious parallel to draw here is a direct comparison to Ruby on Rails. Was Ruby the best, most well known language ever? No. Did people complain at the time and say they should have been using some other more popular language at the time? Yes. Did it achieve a tremendous amount and was it a better product because of Ruby? Absolutely.

So, when you pick up Flutter, just remember that you’re working toward an end goal and you’re not just the victim of arbitrary decisions. Decisions weren’t made because someone preferred one thing over another.

P.S. The Flutter and Dart teams are also incredibly responsive and they love constructive feedback so I recommend reaching out.

标签: Flutter Kotlin
© 2014 TuiCode, Inc.