Adoption of Kotlin and Swift in mobile development, is it time for a change?

Kotlin and Swift in a native mobile development.

11-05-2023DXsparkKotlin, Swift

Kotlin and Swift are the new (not so new) players in native mobile development. Kotlin for Android and Swift for iOS development, respectively.

Enough time has passed since both languages became official for the development of applications for their mobile operating system (Kotlin in 2017 and Swift in 2014), to have a good idea of how these languages were received. by the development community in general, and particularly in Portugal.

DXspark, being a team that develops native applications for both Android and iOS, mostly for both operating systems simultaneously, the choice of programming language when starting a project is paramount.

 

A brief introduction of the technologies in question.

Kotlin is a modern, statically typed, object-oriented (and more) programming language developed by Jetbrains (known for producing tools like: IntelliJ, PyCharm, Rider, Resharper) and unveiled in 2011. It was introduced mainly as an alternative to Kotlin. JAVA for the JVM, being present in both server and application development and being adopted by Google as the official language for Android development in 2019.

Swift is also an object-oriented and statically typed programming language. Developed by Apple itself (needs introductions), with the main intention of replacing the old and outdated Objective-C. Launched in 2014 and open-sourced in 2015, it was further expanded in 2019 when Apple announced SwiftUI, a new declarative way of structuring UIs using the Swift language.

In a quick analysis of the languages and when they started to gain traction, it seemed to us that their evolution would be similar to that of their "predecessors".

Swift, like Objective-c, benefits from a very focused developer community, where most of the information available will be directed towards the exact environment you are developing for, iOS and the Apple ecosystem in general.

Kotlin sees more widespread adoption across different paradigms, such as Java, but has a more dispersed knowledge base, as much of Kotlin's development is unlikely to target Android.

One of the best resources for getting an overview of current development trends is the Stack Overflow Developer Survey. This year's edition tells us that Kotlin is a more popular language than Swift, which is not surprising given our previous analysis of its greater diversity.

Kotlin also boasts a more positive outlook among developers, but that advantage has been diminishing over the years.

According to the Developer Nation Q3 2021 report, Kotlin is used by more than 62% of Android developers while Swift is used by more than 39% of iOS developers, which is a clear indication that Kotlin has seen faster adoption. in the native mobile market.

Another StackOverflow review comes up with a curious number, searching for "iOS" found around 189,703 Swift-related questions while searching for "Android" turned up far fewer Kotlin-related questions, around 51,951 at the time of writing. Considering that no other statistic seems to confirm this reality, let's assume that this result is due to the way questions are categorized on StackOverflow. However, we can conclude that both languages have very active communities.

 

Therefore, what do these data mean for the selection of the development language chosen at the beginning of a future Mobile Project?

All official communication from Google and Apple tells us that it is not only safe, but strongly encouraged, to start new projects using Kotlin or Swift.

Community support is huge and growing as the community slowly moves away from older languages.
Both support interoperability with their older alternatives. If really necessary, it is possible to reuse code from an older codebase.

One detail where Swift and Kotlin differ is that Swift does not support very old versions of iOS (in theory iOS 7, in practice any version prior to iOS 13), however, this is not an impeding issue since iOS users tend to have their devices updated.

All this gives us an interesting overview, but there are some details that only day-to-day experience can shed light on. Going through the process of interviewing candidates for mobile development positions over the past few years, it has become quite evident that most candidates with Kotlin or Swift on their resumes turn out to be more junior profiles. It is also possible to notice that less and less junior candidates are interested in learning Java or Objective-C, especially Objective-C.

Taking all of this into consideration, the answer really boils down to developer availability and the company's strategy.

Questions related to the seniority level required for the project, whether there are the profiles with the necessary seniority to develop solutions in the corresponding languages, whether the senior Java/Objective-C programmers on the team can support the more junior profiles, among other questions. It is important to note that the motivation of programmers and long-term planning turn out to be fundamental factors that favor the learning of the latest languages.

As with most questions, there is no single, simple answer. If you find it difficult to answer these questions and make this decision, or if you need mobile development experts to help bring your project to life, contact us here.

 

Patric Cunha, Tech Leader, DXspark