Should I start learning Kotlin or go with Flutter?

Which one you should learn? Which one to use to start your android development journey? Let’s find it out.

Kotlin For Android App Development
What is Kotlin: Kotlin is a statically-typed open-source programming language generating code that can run on the Java virtual machine. It was developed by JetBrains. It has been gaining popularity for it’s concise, safe, inter-operable and tool-friendly features since the release. According to the information on the official website of the language, some of the leading technology companies, including Atlassian, Pivotal, as well as giants like Uber, Pinterest, Evernote, are actively using Kotlin for their Android apps.
The Pros and Cons of Using Kotlin for Android App Development: Here we will discuss the advantages and disadvantages of using Kotlin for your next android app development.

Pros of Kotlin:

  1. It increases your team’s productivity: Being Java-based, Kotlin, however, eliminates the obsolescence and cumbersomeness of its predecessor. The language is compact, clear and efficient, it has a concise and intuitive syntax. As a result, Kotlin can significantly increase team productivity: It takes less time to write and deploy new code. This also contributes to better code maintainability at scale.
  2. It is compatible with existing code: Kotlin is 100% inter-operable with JAVA. It works well with JAVA as well as with other tools and components of JAVA. Anyone who knows JAVA can migrate into Kotlin easily.
  3. It is easily maintainable: Kotlin is supported by a vast majority of IDEs, including Android Studio, and other SDK tools. This helps increase developers productivity, as they can continue to work with the toolkit they are used to.
  4. It has less bugs: With a more compact and clear codebase, Kotlin allows for less errors and more stable code in production. The compiler detects all possible errors at compile time, not at run time. This makes Kotlin a safer alternative for Java.

Cons of Kotlin:

  1. Kotlin differs from JAVA: Being very close to Java, Kotlin still differs in many aspects. Thus, a certain learning curve is involved for a developer who wants to switch languages.
  2. Slower compilation speed(sometimes): In some cases, Kotlin is by far faster than Java, but sometimes it can get significantly slower and no one knows why.
  3. Not very wide resources to learn: Despite the fact that Kotlin is gaining momentum, the community of developers is still relatively small compared to Java.
    These are the Pros and Cons you should consider when you are learning Kotlin. If you want to learn Kotlin then these are Best Kotlin Books For Android Developers.
    Flutter For Android App Development
    What is Flutter: Flutter is a mobile app SDK (Software Development Kit) that is developed by Google for building mobile applications for major app development platforms like iOS and Android. Flutter comes with a full package that consists of widgets, development tools and framework to provide the app developers the ease of usage.
    The Pros and Cons of Using Flutter for Android App Development: Here we will discuss the advantages and disadvantages of using Flutter for your next android app development.
    Pros of Flutter:
  4. Faster Mobile Apps: The mobile apps developed using flutter app development are way faster in comparison to applications built on other app development platforms. Flutter apps are also smooth in functioning as they offer a great user experience without any cutting or hanging while continuously scrolling.
  5. Perfect for an MVP(Minimum Viable Product): If you want to show your product to investors as soon as possible, you can build your application with Flutter. In that way your investors will have a clear idea of what your MVP looks like.
  6. Hot reload: Hot Reload is considered to be one of the biggest advantages of flutter because of this the app developers are able to see all the changes, including the minor ones in the code right away in real time. With the help of hot reload, developers can also make quick fixes in the app’s code for its smooth functioning.
  7. Access to Native Features and Widgets Support: Setting up flutter is very easy and can be initiated on low-end machines where app developers can access native features like Geo-location and camera. This cross-platform mobile app development platform allows you to reuse your existing Objective-C, Swift and Java code for iOS and Android platforms. It also has Widgets support.
    Cons of Flutter:
  8. Limited Support: It is true that Flutter has built an impressive support community with hundreds and thousands of flutter enthusiasts, but it’s still not enough. In comparison to other support communities, flutter is lacking behind in user support. Also, there are limited libraries that can be accessed by app developers in the flutter.
  9. Continuous Integration: Because of the fact that flutter is still in its early stages, there are not a number of CI (Continuous Integration) Platforms that provide support to it, this includes Jenkins and Travis. That’s why continuous integration support can be referred to as a major disadvantage for flutter development.
  10. No Web Apps: Another negative point for flutter app development is that it is limited to mobile applications and does not cover Web apps. And this can be a major problem as nowadays businesses are looking for support from both mobile apps and web browsers. Thus, flutter lacks flexibility in respect to the web applications.
    Both of these two languages have advantage and lacking. While Kotlin is widely used today, Flutter is still developing. The cross platform compatibility add an advantage upon choosing Kotlin for mobile application development but Flutter lacks the necessary resources now. The choice is yours.

Your question isn’t really Kotlin vs. Flutter as one is a language and one is a platform. The proper question could either be Kotlin vs. Dart, but more likely, Android-only native development vs. cross-platform development with Flutter.

As someone fluent in both I think Flutter is definitely the future, and it is mature. However the adoption rate is low so finding a job in it is hard. I think developing the same app twice with 2 different languages and toolsets is just not a model that scales and that is where Flutter shines, but most of the world seems to be happy doing 2 versions of the same app.

As far as languages I can say that Dart is not a bad language and is “good enough” but coming from Kotlin it is a let down and you will get frustrated with simple things like needing to put in semicolons and the lack of extension functions or some of Kotlin’s nice lambda syntax sugar.

4 Likes

Regarding Continuous Integration, flutter supports number of popular CI integrations

Kotlin differs from JAVA: Being very close to Java, Kotlin still differs in many aspects. Thus, a certain learning curve is involved for a developer who wants to switch languages.

I see this as a huge PRO. Kotlin is close to java only on the binary level. The syntax it’s luckily quite different and very appealing which one cannot say about Dart that is in my option quite ugly.

Not very wide resources to learn: Despite the fact that Kotlin is gaining momentum, the community of developers is still relatively small compared to Java.

This isn’t true. As soon as you know Kotlin basics you can read any Java documentation and easily use any API with Kotlin. The community is great as is Kotlin.

I wonder why Google even created Dart? They could have made Flutter work with Kotlin, the same way Gradle adopted it. The acceptance would probably be great. Flutter is in general a nice idea but Dart is a real deal-breaker. We already have Kotlin, one of the most efficient and best programming languages. Nobody needs Dart with its weird syntax. I hope Kotlin keeps growing and will eventually be made Fluttter’s native language.

I posted to this topic before but think I can add more based on recent experiences. I am a big fan of both Kotlin but also Flutter. I have done some projects in Flutter and for the last 5 months I have been working exclusively on a Kotlin Multiplatform app for iOS and Android.

Dart isn’t really that weird of a language. It is a slight step down from Kotlin though it is getting closer to Kotlin (adding extension functions and nullable types). While Dart is not as nice as Kotlin, it isn’t that big of an issue. I never run into an issue where I think things would be light years better in Kotlin.

In terms of multi-platform development I can say that there is no contest, Flutter wins hands down and I am going to lobby to switch our KMP project to Flutter when we get an initial release out. KMP works great for Android but is not that much help on iOS. There are lots of limitations for iOS. You end up having to write a crap ton of Swift code and iOS layouts. While you can share some business logic you waste so much time having to get things working on iOS it takes longer than writing 2 separate apps. KMP currently does not even have a cross-platform class for representing date and time and the prominent 3rd party library does not really work well on iOS

If you want to learn about Kotlin, how it compares to other languages and if it’s worth looking into, it might be worth checking out AND Digital’s online series on challenger languages. The first event will explore Kotlin >> Challenger Language Series - Kotlin | AND Digital
The recordings will be available on YouTube as well for reference.

KMP currently does not even have a cross-platform class for representing date and time

There is one in the works: GitHub - Kotlin/kotlinx-datetime: KotlinX multiplatform date/time library

1 Like

Yes, I know there is one coming in 1.4 but that doesn’t help now.

Didn’t realize that their new time library was just made available and looks like a nice improvment over Klock.

Lambda functions in Dart. Lambda is a short and concise manner to… | by JAY TILLU | Jay Tillu | Medium – dart lambdas

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

For people who find this topic trying to decide Kotlin Mobile vs Flutter, this applies to you: Kotlin Multiplatform Mobile (KMM) is now Alpha :tada:

2 Likes