Rise of Kotlin: The Programming Language for the Next Generation

简介: Rise of Kotlin: The Programming Language for the Next Generationhttps://hackernoon.

Rise of Kotlin: The Programming Language for the Next Generation

https://hackernoon.com/rise-of-kotlin-the-programming-language-for-the-next-generation-27beeb529204

Please welcome our weekly sponsor Pusher to Hacker Noon! Pusher makes realtime APIs that enable developers all around the world to quickly add communication and collaboration features to their apps. Their core product enables developers to easily create features like in-app notifications, activity streams, real-time dashboards, live trackers and much more.

Today we’re going to catch up with the Pusher Developer Evangelist Zan Markan, to discuss the state of Kotlin, what drives him to do what he does, and what makes a space cowboy a space cowboy.

David: Lets start with the State of Kotlin. You recently ran a Kotlin survey of (more about the nuts and bolts here). You surveyed 2,744 people from January to March 2018 to take the pulse of the ecosystem. What results defied your assumptions? What results confirmed your assumptions? And what’s the elevator pitch takeaway of what’s going on with Kotlin?

zan: That’s right. We noticed more and more developers using Kotlin when building applications with our products so we decided to dig deeper and find out what motivates them. I found out a few surprising things.

First off, I was genuinely surprised by the love students and more junior developers are giving Kotlin. I was expecting a bigger difference between more/less experienced developers, but the new crowds are really getting into Kotlin since Google put its guns behind the community.

Another thing that surprised me, was how many people are keen to try out the features that are labeled as experimental by the Kotlin team, namely coroutines and support for multi-platform projects — about 25–30% each.

The results of the survey more or less confirmed my suspicions on how big Android is — around 80% according to our survey data. Some other surveys I’ve seen show a bit less of Android, yet still comfortably above the 75% mark. Some of that difference might be down to my network being mostly Android-focused, but the effect wasn’t clearly as big.

One takeaway is that Kotlin is an exciting language, and one that makes developers happy.

That’s quite rare (for something such as a mainstream programming language at least), and has resulted in a vibrant and enthusiastic community that formed around the whole Kotlin ecosystem.

Kotlin’s primary development is from a team of JetBrains programmers based in Saint Petersburg, Russia. What else can you tell us about its founding? And when did you first use Kotlin?

To my knowledge, Kotlin’s history is that of JetBrains wanting a “better Java” for their developer tools. Interoperability and improved productivity were some of their main goals, and no other JVM-based language at the time really fit the bill — Scala ticked most of the boxes, but the tooling just wasn’t there, and the build times were way too slow for JetBrains’ development needs.

That exact idea of a highly interoperable and better Java was why this started to attract so many Android developers (including me, having done Android since the early days).

A few years ago the Android ecosystem was mostly stuck with an old version of Java — a weird hybrid between Java 7 and Java 6, which didn’t have nice features like lambdas and was quite verbose. So people started playing with this new thing that seemed nicely interoperable and allowed for greater productivity (especially the times it didn’t break everything ).

That’s what dragged me into it as well — I first heard about it in 2014, and then kept a close eye on Kotlin’s development — either by playing with it in my spare time, or using it to quickly prototype things. I wrote the first production Kotlin code when working on the Pusher Chatkit and Feeds products.

Why do you think Kotlin catered to less experienced developers? And what’s to stop it from being a fad?

Ha! I don’t think it caters to less experienced developers per-se, in fact I see it as quite a similar grouping as we’ve seen with the StackOverflow survey results so nothing unexpected in terms of how the industry is developing.

We’ve also seen that it was first picked up mostly by experienced (employed) developers, and only recently started seeing adoption with students and younger developers.

I see Kotlin as a quick language to pick up. There is excellent tooling that allows us to be productive even without knowing most of it. It’s interoperable with Java, so any porting or migration can happen at your own pace. And lastly, both Google and JetBrains are doing great jobs preparing documentation and resources supporting Kotlin.

What separated Kotlin from other programming languages that you think drove its rapid adoption? And more generally, what do you think separates programming languages that gain adoption from programming languages that struggle to gain adoption?

Support from Google and JetBrains has definitely helped. On the other hand, Google decided to support Kotlin in Android officially only AFTER the massive push from the developer community, so there was already a substantial push from the other side as well.

I actually think it’s a language that appeared at the right time, in the right community — the Android community, as it matured, and people wanted new tooling to become more and more productive. Kotlin, was just there, sure it had its flaws, but it was there and good enough for people to do it right.

How do you seen Kotlin effectively competing and complementing existing languages and architectures over the next 5 years or so?

If we start with the obvious, then Java is rather easy, and Kotlin already complements it well. I believe we’ll definitely see more of that, especially when the tooling consolidates and a few “gold standard” tools emerge. One of these tools is Arrow, a functional programming toolkit for Kotlin, that developed from Funktionale and Kategory teams joining up to create something better, more complete. I think that’s going to be the trend.

As for other programming languages — on the JVM we’ll see what happens with Scala and others, and outside of the JVM world it’s still too early to tell, but I’ve seen some promising ideas about Kotlin/Native and Kotlin for multi-platform projects — both still very experimental, but some proofs of concept are there, working and quite exciting.

When Alberto Ballano’s “Kotlin Functors, Applicatives, And Monads in Pictures” made it onto Hacker News, it brought up an interesting discussion… What do you think Kotlin is a gateway drug to?

That sounds nefarious! It’s a gateway drug to modern programming languages — ones that make us both productive as well as happy.
It will definitely expose a number of people to functional programming — especially with things like Arrow, and that might let some people jump into more hard core FP languages easier.

A few other things it might do is spur a bunch of Android developers to venture into web or native development, with all its cross-platform support, and also, as more and more developers pick it up as their first programming language, they will inevitably come to see Kotlin as a benchmark they measure all other languages against, and that’s also quite exciting.

In linguistics, it takes a very long time for a language, like English or Spanish, to gain adoption. And they are many dialects, but the usage of an entirely new spoken language is must less prominent than the usage of new software languages. Do you think we’ll hit an industry maturity point where the rate of new software languages declines? Or will more new software languages continue to emerge?

We’ve already seen a bunch of excellent programming languages gain some serious adoption quickly, and in the recent years — Swift, Go, TypeScript, and Rust come to mind. Each of them is supported by one (or more) large engineering organisation with substantial resources and existing developer communities behind it.

Each of them also scratched a particular itch of their organisations, and if that itch is shared by a lot of other developers then adoption happens and a language takes off, allowing it to achieve “critical mass”. That’s what happened with each of these languages I mentioned — Go for instance started when Google wanted to do concurrency well, and one of the objectives of Rust was never crash.

As for future, I think there’ll definitely be new computing paradigms, new ideas being developed (who knows, maybe Blockchain will actually become a thing someday) — that won’t be super useful with our existing tooling.
Some other examples is quantum computing or AI.

While most languages nowadays claim to be general purpose, that still doesn’t mean they are equally well suited for every purpose. We’ll see new purposes that will demand new languages.

Let’s talk about Zan the person. The first two words of the bio on your personal website read “Space Cowboy.” Do some people call you the gangster of love? Do other people call you Maurice? Do you embody the pompatus of love?

Ha, I love that song! Gangster of love, perhaps, as I don’t think anyone’s managed to misspell Zan into Maurice, not even the Starbucks staff. I also love rockets and still mourn the loss of Firefly, so that’s also kind of a space cowboy theme.

The actual story behind that “title” is that a few years ago, when I was still running a startup I founded with a few friends out of university. To look slightly more legitimate when asking strangers for money (ie raising an investment), we had business cards made for each of us.

I’m not big on titles, especially C-titles when everyone is doing pretty much everything, so I just decided to go the other way and picked Space Cowboy which is about as (in)accurate as anything. At least I figured it would be a good conversation starter.

The fact you asked about it just proves how good a conversation starter it really is.

You’ve been said to like West Coast style IPA. I’m in Colorado now and miss Laguinatis. What are your top 3/5 west coast IPAs?

I like them violently strong and ruthlessly hoppy.

Whenever I visit the West Coast I make sure to have a Pliny the Elder by Russian River, and of course Stone IPA — both draft, obviously. When closer to home my go-to would be Jack Hammer by Brewdog.

What makes a good developer evangelist? How have you gotten better at your job? What makes Pusher technology worth evangelizing?

The most important thing for a dev evangelist (any developer relations person in general) would be a genuine passion to teach, and share knowledge. Actually, it’s probably even more important to be genuine. Full stop. Developers are natural BS detectors who hate being sold things.

It’s also a great feeling when you know you’ve helped someone become a better developer.

One of the first things that I’ve had to get better at is time management. Coming from a developer background, it’s way more common to have large chunks of time that you allocate to certain tasks. My current job is way more dynamic than that, and at first when I didn’t expect that change, or adjustment, so it was quite overwhelming. Paul Graham’s excellent essay on maker’s and manager’s schedules helped me a lot.

Another useful skill that I’ve picked up is project management — with State of Kotlin for instance, most of my work revolved around setting up the survey, and creating the content at first, and then moved into more classic project management, like coordinating with other teams involved, such as design and dev (they’ve done that work, not me, thanks again — you know who you are), and finally in getting the word out in various publications, doing interviews on the Web.

Pusher’s tech is renowned for how quick it is to integrate, as well as for the fact “it just works”.

As such, it’s a breeze to evangelise. I’ve even had people come to me at a mobile development conference and tell me that their colleagues in the web team that use Pusher told them to tell me how great our Channels product is — that was exciting

All in all, where does Kotlin fit into realizing Pusher’s long-term vision?

We already bet on Kotlin as the primary development language for our Android SDKs. We started with the SDKs for the new products — Beams, Chatkit, and Feeds, and we’re currently quite happy with that.

We also believe that Kotlin has one of the most exciting and engaged communities, and that’s also part of the reason why we decided to create the State of Kotlin survey and the report for it. We certainly hope that Kotlin keeps making developers happy and productive, and the State of Kotlin helps drive its adoption further!

Pusher, our weekly sponsor, makes communication and collaboration APIs that power apps all over the world, supported by easy to integrate SDKs for web, mobile, as well as most popular backend stacks. Get started.

Kotlin 开发者社区

国内第一Kotlin 开发者社区公众号,主要分享、交流 Kotlin 编程语言、Spring Boot、Android、React.js/Node.js、函数式编程、编程思想等相关主题。

img_f0a9a5e3c63edb2cda8899c204e13bbf.jpe
开发者社区 QRCode.jpg
相关文章
【Kotlin 反应式编程】第1讲 你好,Reactive Programming
【Kotlin 反应式编程】第1讲 你好,Reactive Programming 1.创建 Gradle Kotlin 项目 image.
1801 0
|
前端开发 JavaScript Java
《Kotlin 反应式编程》使用 RxKotlin 实现一个极简的 http DSL ( Reactive Programming Using Rx Kotlin )
《Kotlin 反应式编程》使用 RxKotlin 实现一个极简的 http DSL Reactive Programming Using Rx Kotlin https://github.com/ReactiveX/RxKotlin RxKotlin: RxJava bindings for Kotlin 使用 RxKotlin 实现一个极简的 http DSL ( Reactive Programming Using Rx Kotlin ) 我们现在已经基本知道 Kotlin 中 DSL 的样子了。
1708 0
|
Java Spring
On the Rise of Kotlin
On the Rise of Kotlin JUNE 20, 2017On the Rise of Kotlin https://blog.heroku.
1216 0
|
Java Scala Android开发
What is the future of Kotlin programming language?
Elina Bessarabova, works at Mind StudiosAnswered Mar 31 Good afternoon here, and thank you for an interesting question to ask...
1328 0
|
1月前
|
JSON 调度 数据库
Android面试之5个Kotlin深度面试题:协程、密封类和高阶函数
本文首发于公众号“AntDream”,欢迎微信搜索“AntDream”或扫描文章底部二维码关注,和我一起每天进步一点点。文章详细解析了Kotlin中的协程、扩展函数、高阶函数、密封类及`inline`和`reified`关键字在Android开发中的应用,帮助读者更好地理解和使用这些特性。
25 1
|
2月前
|
Android开发 开发者 Kotlin
告别AsyncTask:一招教你用Kotlin协程重构Android应用,流畅度飙升的秘密武器
【9月更文挑战第13天】随着Android应用复杂度的增加,有效管理异步任务成为关键。Kotlin协程提供了一种优雅的并发操作处理方式,使异步编程更简单直观。本文通过具体示例介绍如何使用Kotlin协程优化Android应用性能,包括网络数据加载和UI更新。首先需在`build.gradle`中添加coroutines依赖。接着,通过定义挂起函数执行网络请求,并在`ViewModel`中使用`viewModelScope`启动协程,结合`Dispatchers.Main`更新UI,避免内存泄漏。使用协程不仅简化代码,还提升了程序健壮性。
82 1
|
3月前
|
调度 Android开发 开发者
【颠覆传统!】Kotlin协程魔法:解锁Android应用极速体验,带你领略多线程优化的无限魅力!
【8月更文挑战第12天】多线程对现代Android应用至关重要,能显著提升性能与体验。本文探讨Kotlin中的高效多线程实践。首先,理解主线程(UI线程)的角色,避免阻塞它。Kotlin协程作为轻量级线程,简化异步编程。示例展示了如何使用`kotlinx.coroutines`库创建协程,执行后台任务而不影响UI。此外,通过协程与Retrofit结合,实现了网络数据的异步加载,并安全地更新UI。协程不仅提高代码可读性,还能确保程序高效运行,不阻塞主线程,是构建高性能Android应用的关键。
62 4
|
4月前
|
安全 Android开发 Kotlin
Android经典面试题之Kotlin延迟初始化的by lazy和lateinit有什么区别?
**Kotlin中的`by lazy`和`lateinit`都是延迟初始化技术。`by lazy`用于只读属性,线程安全,首次访问时初始化;`lateinit`用于可变属性,需手动初始化,非线程安全。`by lazy`支持线程安全模式选择,而`lateinit`适用于构造函数后初始化。选择依赖于属性特性和使用场景。**
156 5
Android经典面试题之Kotlin延迟初始化的by lazy和lateinit有什么区别?
|
4月前
|
安全 Android开发 Kotlin
Android经典面试题之Kotlin中常见作用域函数
**Kotlin作用域函数概览**: `let`, `run`, `with`, `apply`, `also`. `let`安全调用并返回结果; `run`在上下文中执行代码并返回结果; `with`执行代码块,返回结果; `apply`配置对象后返回自身; `also`附加操作后返回自身
62 8
|
4月前
|
安全 Java Android开发
探索Android应用开发中的Kotlin语言
【7月更文挑战第19天】在移动应用开发的浩瀚宇宙中,Kotlin这颗新星以其简洁、安全与现代化的特性,正迅速在Android开发者之间获得青睐。从基本的语法结构到高级的编程技巧,本文将引导读者穿梭于Kotlin的世界,揭示其如何优化Android应用的开发流程并提升代码的可读性与维护性。我们将一起探究Kotlin的核心概念,包括它的数据类型、类和接口、可见性修饰符以及高阶函数等特性,并了解这些特性是如何在实际项目中得以应用的。无论你是刚入门的新手还是寻求进阶的开发者,这篇文章都将为你提供有价值的见解和实践指导。