Atlas · Details
Why Kotlin Is Better Than Whatever Dumb Language You're Using
Author’s note
The Kotlin team reached out after this one; they were delighted. I heard the Android core team down in Mountain View was irritated that I had critized their shitty APIs. Because, you know. Criticism bad. But I can tell you, re-reading this essay nine years later, my blood pressure absolutely spiked when I read "Fragments." Android is horrible, and Kotlin really does make it better.
I think the Count von Count picture and caption, an amazing four-way joke, is one of the finest gags of my writing career.
AI Notes
Steve admits the title is clickbait — "where would the internet be without it?" — and writes the essay anyway. The occasion is an Android port of his decades-old game Wyvern. Android programming turns out to be as bad as everyone warned (the Fragment and Activity lifecycles "maddeningly awful"); his first attempt he gave up on for half a year. What rescued the port was Kotlin, the then-new JVM-and-Android language out of JetBrains. Steve had looked at it the way he'd looked at fifty other languages on his quest to replace Java with anything reasonable, and didn't expect to use it. Within a month he was rewriting his twenty-year-old game server in it. The essay's case is partly the language — concise where Java 8 makes you say interesting things "with a mouthful of sand," coroutines, clean modern design — but mostly the tooling: Kotlin was built IDE-first by world-class IDE makers, and that's why it's so easy to pick up. It's "just butter." Steve frames the choice as a blue-collar working programmer who wants street food, not the truffled snails of Scala and Clojure.
Written May 2017 — the same season Steve left Google. It catches him mid-pivot, happy in a new language, rebuilding his oldest project.
Related listings
-
2006
Execution in the Kingdom of Nouns
The direct callback. This essay describes Java 8's "parallel streaming filterable collecting scheduled completable callbacking futuring listening forking executor noun kingdom" — a one-line nod to the noun-kingdom argument Steve had made, in earnest, eleven years earlier.
-
2008
Dynamic Languages Strike Back
Two stops on Steve's long quest to replace Java with anything reasonable. Dynamic Languages Strike Back made the case for the dynamic camp; nine years on, Kotlin is where the static-typing search finally found a home.
-
2005
Bambi Meets Godzilla
Bambi Meets Godzilla argued that how good a language is barely matters to its adoption. This essay says it again in passing — and then makes the opposite bet, that this time the good language has the tooling and the buzz to actually win.
Where it was argued
- Hacker News May 2017
From the peanut gallery
Read the rest of the thread · 34 more
-
I've also ended up using Emacs along side Jetbrains IDEs (PyCharm & Webstorm). It is an odd combo but it works great. Emacs for mind-control level text editing, and the IDE works great for mouse-oriented poking around and small edits.
-
Welcome back, Steve, we've missed you :-)
-
Great post!
Good to see a new post by you Steve ;) -
I love C# and have been really disappointed to see how far behind Java has fallen, especially as my work tends more towards the JVM. Kotlin looks very interesting!
-
Great article! JetBrains is Czech, BTW.
-
Re the name: Java was named after an island, and so is Kotlin - an island near St. Petersburg where JetBrains have offices.
-
Good rant!
BTW, JetBrains is not really Czech. Yes, it is incorporated in Prague, but it is physically in St. Petersburg, and pretty much all the management and the devs are Russian. Most of the people graduated from the SP University.
On the name. Java the language is named by Java the island. Kotlin is the island in the Gulf of Finland off St. Petersburg. Peter the Great took it from Swedes in the early XVIII century, and since then it's been the base of the Russian Baltic Fleet. It's actually has some kind of northern monumental beauty. The Naval Temple is pretty impressive.
So here you go, Kotlin is your "Java" from St. Petersburg.
Our company (from Atlanta, GA) tried different JVM languages, Java being the primary one. Now we pretty much converged on Kotlin. Everybody likes it a lot. And, interop with Java is smooth.
Kotlin also compiles to JS, and, it's worth mentioning that Kotlin Native is in very active development. It looks to become a very strong competitor to the likes of Rust. -
I'm enjoying Kotlin too and was pleased to see today that Google announced support for Kotlin in Android!
https://venturebeat.com/2017/05/17/android-now-supports-the-kotlin-programming-language/ -
Thank you for this brilliant write-up, Steve! I have just started building apps for iOS and almost given up on Android. I will surely get my hands wet with Kotlin to see if it brings back the charm of developing for android.
-
Languages designed with IDE's:
Almost any version of BASIC
Turbo Pascal 3
C
Yes, C. not a very good IDE perhaps (the conceptual parent of ECLIPSE), but unix was 'the C programming environment'. You could compile, edit, run, from right there in the Integrated Design Environment. (BASIC was better of course, and eventually evolved into Visual Studio). -
Ah, can I interest you in a little cross-platform Swift?
Scade is going through some painful adolescence at the moment, acne and other changes. It also has a Slack nexus, which attracts a fair number of people wanting to write a sports car and house's worth of game without really knowing what goes into e2e goodness.
Anyway, you've convinced me to look at Kotlin seriously. And pedal to the metal version, too. -
Designed with/for an IDE: Smalltalk.
-
How could I have forgotten Smalltalk? Embarrassing. But it just goes to show how impactful IDE-first languages can be. Generations of languages are indebted to Smalltalk.
Heya Cedric, heya Tor. :) We need to start a Kotlin blogstorm. -
No doubt Kotlin is better than Java (hell, ANYTHING would be better than Java for Android dev). I used to think I was just being a whiny baby for not wanting to do a native Android app because of the verbose and laborious API; glad to know I have some company :-)
However, while I'm not sad that Kotlin got adopted I still remain hopeful that Groovy will be given the nod next year as well. I cannot deny that I've had a heaping mountain of fun using Groovy for the greater part of a year and I don't want to leave it for anything. -
Kotlin predates Swift?
From Wikipedia:
July 2011 JetBrains unveiled Project Kotlin, a new language for the JVM, which had been under development for a year.
Development of Swift started on July 2010 by Chris Lattner, with the eventual collaboration of many other programmers at Apple. Swift took language ideas "from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list".
[1] https://en.wikipedia.org/wiki/Kotlin_(programming_language)#History
{2] https://en.wikipedia.org/wiki/Swift_(programming_language)#History -
"IntelliJ doesn't like it when you type fast. Its completions can't keep up and you wind up with half-identifiers everywhere."
As the Emacs config guru that you are, I'm half-surprised to see you didn't tick that feature off of IntelliJ's config.
Preferences -> Editor -> General -> Code Completion -> Autopopup
Or, quicker: C-S-a, then type "autopopup", Enter
BTW it was so nice to read you again :) -
Simpler to remember:
C-S-a
then type: code completion
Enter -
Hey Steve, have you looked at Nim (nim-lang.org)? Another interesting, clean language for blue collar programmers.
-
Hey steve, what OS are you using these days?
-
Steve: I've been blogging about Kotlin since 2011. Your move :-)
You should drop by in the kotlinlang to say hi! -
If it is 10% more succinct than Jython, how more succinct it is compared to Java then?
-
"Of course, I always need to switch over to Emacs to get real work done."
I was always wondering about this real work done in emacs. I can understand reading logs in emacs: its regexps+elisp can do magic, but writing code? Of course one can write a real parser like you did for js, but to support multi-file projects with libs one would have to implement an IDE. Things like multiple cursors or editing in a rect-mode are sometimes useful (btw IntelliJ has them too), but usually if one can apply them to the code, then it is possible to extract some logic and edit it in a single place. So what is this real work which is easier to do in emacs?
(emacs-user, touch-typist) -
Also, ermagherd, one language might have slightly started before the other, and yet co-evolved into very similar things. Shocker. Who cares which one came first? It's not like they both didn't borrow heavily from their forebears.
-
Steve,
What did you think of Ceylon? I wonder bc it has good Java interop and was designed by good team of JBoss devs who also wanted a better Java. -
I'm happy to read this article. I love Jetbrains editors and Kotlin gave me a good impression when I used it for a little Android app a few months ago. Kotlin might easily become my favorite language because it's statically typed (something I can't live without) and it features modern syntax without being over complicated like Scala (e.g. implicit parameters, dsl-like syntax) or Swift (e.g. many ways to declare a variable, some objc baggage). I think it reaches the sweet spot, with enough modern features but without getting too fancy.
I don't know if there is another language as interesting as Kotlin, especially now that it's supported by Google. I'm glad Google chose Kotlin and not Swift. I hope I can code iOS apps in Kotlin soon too. I don't like Swift very much. And, by the way, Xcode leaves a lot to be desired. At least I have AppCode.
In other words: I think jetbrains know quite a lot about code so I'm sure Google made the right decision. IntelliJ+Kotlin is much better than Xcode+Swift. -
Nice article. As far as languages that were designed hand-in-hand with an IDE, the oldest one that comes to mind is SmallTalk-76.
-
Hi Steve,
I've been a big fan ever since your, "The Next Big Language" blog post in 2007. Since then, I too have been on the lookout for the NBL.
Kotlin is starting to look like it could be the NBL.
Please consider writing a blog post that evaluates Kotlin against the "rules" you wrote in your NBL blog post. -
Come on DevDanke - JS was the NBL. Steve correctly predicted that, and even wrote about it :)
-
This comment has been removed by the author.
-
Thank you for this brilliant write-up, Steve! I have just started building apps for iOS and almost given up on Android
จีคลับ
goldenslot -
I hope Kotlin isn't like Swift. People tell me that Swift is like Scala, and Scala is a monstrously complex language. Scala is so complex a language that the compiler compiles at a glacial pace. Scala is notorious for being an almost "write-only" language because its flexibility allows users to do wickedly obscure things.
If Swift is like Scala, I'd stay away from Swift. I hope Kotlin isn't so complex a language. -
Great post on Kotlin and also IntelliJ IDEA! By the way, I have had Wyvern installed on my iPhone since January so thanks for the experience (so many different character classes!). Good to see that you've embraced something other than emacs. :-)
Ever thought about posting a new JVM Shootout with some relevant / commonly used present (2015 - now) JVM based languages? JetBrains is going to make Kotlin native so it'll be interesting to see how that pans on in the near future.
Keep on blogging and happy programming to all! -
This comment has been removed by the author.
-
Great post, I's so interesting. Thanks for sharing.
gclub casino
goldenslot casino
บาคาร่าออนไลน์
@Richard Eng,
This might upset a lot of people, but I would call Kotlin "Scala: The Good Parts". Think of Kotlin as Scala without:
1. Operator overloading of more than one character. Kotlin lets you overload "-" or "+", but you can't make "==?=/\/\$%" into a function call. Scala allows all of it, and some code in the Scala Liftweb framework or SBT build files looks like modem line noise.
2. Implicit function parameters. Hard to reason about when you can't see it right in the call in front of you.
3. Macros. (Arguable whether this is a drawback.)
4. Complex for-comprehensions. (Makes the code harder to read.)
5. Slow compile times. Depending upon what you read, Kotlin compiles at the same speed as Java or maybe up to 20% slower.
— EsauCairn · 8:25 AM, June 08, 2017
+Kafka re: the start date: you're comparing the *public unveiling* date of Kotlin (you can for example see their slides from 2011 here - https://blog.jetbrains.com/kotlin/2011/07/slides-from-the-jvm-language-summit-presentations/) with the *internal start date* of the other project. Kotlin work obviously started earlier than its public unveiling; by July they were demoing IDE support for their language etc.
— Tor Norbye · 5:00 PM, May 19, 2017