Kotlin beyond Android: A risk?

Support for a language is dependant on the popularity of that language.  The only possible risk in choosing kotlin is the project becoming an orphan as kotlin never gains sufficient traction in the relevant space.  Choosing any language on the assumption that popularity will increase is a gamble,  so understanding the popularity of kotlin now and are the prospects for future popularity is essential in understanding the risk of future kotlin support.

Depending on the language popularity indicator you reference, kotlin is either climbing the rankings or already very near to top.  Kotlin on Android is widely tipped to overtake Java as the number 1 language, and choosing the number 1 language cannot really be considered a risk.  Could choosing Kotlin for development other than Android still be considered a risk, given the positive signs for kotlin uptake?

How do you measure popularity?

One approach is to track how often a language is mentioned in searches(such as Tiobe or Pypl), another is by questions asked or questions asked (such as stack exchange tags), and a third is by  the other is by specifically recording ratings or language preferences.  The mentions approach is somewhat reminiscent of what drives fake news, and it would seem by such a mention that at the date of this post (Oct-Nov 2017) Harvey Weinstein has just rocketed in popularity because he has been mentioned far more often lately, but unfortunately those mentions have been for the wrong reason.  It could also be argued that complex logic and lack of specific community forum is going to drive more questions on stack exchange, but at least the likes and dislikes should accurately reflect sentiment on a language if not necessarily how many people are acting on that sentiment.

The likes/dislikes.

This like/dislike sentiment data shows kotlin (along with the other recent static typed languages Rust, Typescript, Clojure) are the most liked, followed by the next block with slightly less liked recent static typed languages together with the giants of the dynamic languages (e.g. python, javascript), then quite some distance back follow the more established older generation of static typed languages. java, C++ and C#.

Update: Although this page from tiboe in November 2017 was published after this pages initial publication,  I feel it is very relevant:

November Headline: What happened to the scripting languages?


There has been a time that dynamically typed languages, also known as scripting languages, were the future. Easy to write, easy to run. Why do you need to declare a variable before you can use it? Why do we have to use all these type annotations all the time? As a consequence, languages such as Perl, Python, PHP and Ruby were very popular in those days.

Today is a different story. Only Python is going strong. The other scripting languages are gradually moving out of the top 20. What happened? Most errors in scripting languages occur run-time. They show up when a program is run. Despite the fact that one can write all kind of unit tests to compensate for this, it remains quite dangerous because such errors might happen while running the application in production. Since quality demands are getting higher and higher, hardly anybody dares to write a critical and large software system in a scripting language nowadays. Even a scripting language such as JavaScript that is inevitable while doing web programming was forced to evolve to a safer language. Microsoft introduced a typed version of JavaScript called TypeScript and all kinds of frameworks such as Angular and React were developed to safeguard the language (and also add extra functionality).

On the other hand, the statically typed languages responded to the threat of scripting languages by reducing their type verbosity: it all started with the “var” keyword in C#, followed by type inference in Java and auto specifiers in C++. And this is how the big languages always seem to survive: by cherry picking the nice and promising features of their competitors.

The ‘Popularity’ Indicators.

Being ‘popular’ can actually refer to being talked about, which does not mean being liked.  Tiobe and PyPl record being talked about, and fortunately in these rankings this is not subject to manipulation by trolls and fake news to get the wrong things talked about, so talked about with languages does correlated well with the language usage level, but does not correlate directly to being liked.   The correlation is between the like/dislike and the trend on popularity indicators, not the actual rank.  Reading the current Oct 2017 data, Tiobe ranks the older static typed languages (Java, C, C++ and C#) as the most popular group, but with these all trending strongly downward reflecting that 3rd tier like/disliked sentiment(particularly Java, C).  Next are the established dynamic languages Python, JavaScript and PHP, with Python and trending upwards, and the disliked PHP trending downwards.  Those highest on the like/dislike scales such as kotlin and rust, do not even rank in the main group (typescript stats are included with JavaScript on tiobe, so no real stats are available).   PyPl ranks Java (from the traditional static languages) first but python from the dynamic language group second, and on a trend to overtake Java. This time the most liked languages Kotlin and Typescript and Rust are ranked in the main group, with Kotlin and Typescript the first and second strongest growing languages respectively.

What does it all mean?

The data suggests programmers prefer Kotlin, Typescript and Rust, but the largest codebase is Java, C, C++ and Python.  Codebase for the liked languages should grow if they can achieve credibility and stay liked, and codebases for the disliked languages would be expected to slowly diminish if they programmers have any choice.  Change in the codebase generally changes slowly, Java has been the topic language in the ‘popularity’ rankings since the year 2000, but on a negative trend over that entire time even though on most data is still retains that most dominant position.

Summary:

  • Most lines of Code: Java  (most liked a long time ago)
  • Most used by programmers to write code now: JavaScript, Python (previously most liked)
  • Most preferred to write code now: Kotlin, Rust (the current favourites)

Java was extremely popular, then dynamic languages took over, but have generally lost their appeal. What developers want right now is a statically typed, concise expression language.  Kotlin is an exact fit.  It takes along time for the desires of developers to translate into the number on the indexes, which reflect what is used, or was used to write the code that is out there. So the current desires of developers have to stay in place for a long time for what they want to become popular in the popularity indexes.   I will post separately analysing the merits of what is currently popular, to see if this is a fad and the dynamic scripting languages will make a comeback, or the concise static typed languages really are the future.

The caveat is that limitations on collection of the data means all the figures are open to interpretation.

Android a special case?

Kotlin is strongest in Android.  Is that strength artificially created by something special about Android, or likely to spread to other uses of kotlin?  As stated before, graphs like those available on the tiobe rankings, show Java as being dominant but in decline almost since the year 2000.  On the liked scale the Java language does not rank well, so this would make the dominance of Java on android,  imply that programmers in 2009 when Java was not liked chose Java to develop their Android Apps  Question: Why did programmers choose to program in Java in 2009?  Answer: It was really the only language choice available.

Although only hitting the big time in 2009, the operating system that took the name android was the evolution of a concept dating much earlier, and the idea of the Java Virtual machine was central to the original concept of an OS for small devices which could use incompatible CPUs.

The end result was that for a long time, the best language in practice to use to program Android was not necessarily their own choice.  This is despite Android development being heavily biased towards Technology Product Software Engineers who are the most likely to choose their own language when possible, and are generally ready to embrace the cutting edge. I suggest this created a pent up demand for a new language choice in the Android community.

Quite a number of high profile developments did not even wait for Kotlin 1.0.  However Kotlin became more attractive as an alternative for many with the release of kotlin 1.0 in very early 2016.  Others may have been waiting for the announcement in May 2017 by google of official support for kotlin.

But most projections show Kotlin will overtake Java on Android by the end of 2018, while I have not seen any suggestion that Kotlin will be even close to overtaking Java overall in 2018.  Outside of Android, any takeover would take much longer.

Clearly Android is a specific arena, with different dynamics for the choice of language that applies elsewhere.

Non Android:  Java vs Kotlin

I suggest that outside Android, the use of Java is heavily biased towards Bespoke Corporate Software, as opposed to Technology Product software.   I suggest this means the people using Java outside of Android are more conservative with their language choices.  Bespoke corporate software is often specified by a group quite separate from the programmer, and the customer is always right.   With technology products it is more the programmers choice.  Consider for Bespoke software, a bank (the ‘customer’) may specific the language they want one of the systems written with, while for Product Software (e.g. a new android game),  the customers for the game are not likely to specify what language the program is written with.

If you want adoption of a new language, perhaps it takes the Technology Product Software industry to lead the change, and through Android, perhaps Kotlin has already converted the major group of Product Software engineers who would have been programming in Java.

Conclusion:  Non-Android Java adoption shows far slower adoption of kotlin than has been the case with Java for Android.  Further kotlin adoption through Java from non-Andoid alone could stall growth of kotlin.

C/C++ As the Next Target?

If Tiboe alone is used as the reference of language popularity, then C/C++ is the next place to look for programmers who could adopt kotlin.  Kotlin native, opens this path, and the choice of IDE (CLion) suggests C/C++ programmers are the target market.  This is a great move, but if you consider pypl together with tiobe, the overall conclusion of falling popularity of C/C++ is that use for new projects is low (as is also the case with Java).

Popularity on PYPL would suggest Python, PHP and Javascript are more popular than C/C++ at this time, and for these languages, the adoption rate for new projects is also stronger.  So while C/C++ is a great extra potential base, it is not the main extra potential base.

JavaScript ?

Kotlin already compiles to JavaScript.  Our team uses kotlin for javascript partially because the result is one less language, and partly because the DSL capabilities fit well with our project.  But to have those entrenched in javascript move could be a greater challenge, with typescript as a popular choice and an easier migration. Beyond the current capabilities, what would further entice javascript developers?  To me, one of the strongest cases for kotlin over javascript is the ability to share the code with other projects- and the best way to present that case is by enticing non-javascript projects to kotlin.

Python and PHP ?

If the most of Java developments outside of Android are indeed Bespoke Corporate projects, and the Kotlin popularity growth fed by winning over Java projects may now plateau, could enticing Python PHP and Ruby developers be a key source of continuing the popularity rise?

Certainly Python, Php and Ruby projects should consider the ‘static types for mature projects’ as some motivation.  In numbers, pypl would suggest there once python and php are combined the numbers exceed those of java, and that is even before excluding android java programmers to focus only on non-android java programmers.  Stackoverflow has more questions tagged python than are tagged java.

Clearly the python/php/ruby group is the largest group current not specifically targeted by an kotlin initiative.

Also, clearly a larger group than non-android Java programmers.   So the biggest potential probably lies within this Python/PHP/Ruby group, but what can be done to win them over?

Just like the original success of kotlin with Android,  the source of new recruits can be a surprise, but Jetbrains may respond well once the move starts.  The main need to capture this group is the focus on getting the very first simple program going, and that includes managing that if gradle is the preferred build tool, how can it be as simple as possible for the minimum project.

Success here will likely have the biggest impact on the future of kotlin.

What are the challenges?

The new areas targeted for some time, non-Android Java and JavaScript, may not accelerate sufficiently to ensure growth does not flatten as Android migration matures.

The two new initiatives are kotlin native as a C/C++ alternative, plus positioning kotlin as a cross platform mobile solution contender with though the addition of iOS support.  Kotlin native vs rust?  How about sharing code base from browser to JVM.

Probably biggest question is to how can kotlin become a kotlin alternative, which means easy for simply projects and a large base of libraries that are simple to access.

Conclusion.

Use of kotlin beyond android, still comes as some level of risk of becoming an orphan.  The needs at risk if interest drops are:

  • development tools (safe, given Jetbrains commitment)
  • libraries (safe only for Android at this time, uptake dependant)
  • peer support (assisted by discuss, but uptake dependendant)

Kotlin is well placed to pick up on the move from older static typed languages, but little is in place at this stage for kotlin to score wins from the dynamic languages.

For each development type covered in implementation pages, I will add a risks section to the relevant Implementation page. So refer to that section for specific risks.  At the moment, kotlin has interest levels beyond its actual measured popularity, because of rising popularity.  The questions is what happens if there is a popularity plateaux.

1 thought on “Kotlin beyond Android: A risk?”

Leave a Reply to Jacinto Elleby Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s