For all its warts, Java has served me well. And as Android’s native language, it’s been a true blessing in disguise. Who knew all those years of writing webapps would turn into such an awesome mobile opportunity?
But I’ve never had strong feelings about Java itself. I liked some things about it, and I hated others. Whatever…it did the job. It was fine. For many years my perspective was simple — I didn’t have to love Java (or whatever programming language) to do my work well. That all changed a few months ago when I wrote my first Kotlin class.
It was a popup adapter in just 86 lines (17 of which were package and import statements), and I couldn’t get over how concise and readable it was. I could barely comprehend how little I wrote to get something to work. It took me a few passes, but all of a sudden, I sensed the difference. This wasn’t just about language features or what the FAQ said the language was capable of. This was about how I felt.
It was genuinely fun. I found myself smiling. I found myself saying “holy shit” more than a few times. I’d read code over and over and couldn’t believe how much I was accomplishing in so few lines. I couldn’t believe the clarity of the writing. Over the next few days, I wrote more and more Kotlin. I wrote my first extension. Then I converted an existing helper class and instantly cut 94 lines. I wanted to write more!
With just a few hours of effort, I cut 94 lines without breaking a sweat. I was amazed, excited, and having a ton of fun. I was also slightly freaked out by this weird new experience brought on by a programming language.
Then it finally dawned on me. Oh my God, this is it. This is what loving a programming language is like.
Over the next couple of weeks, that warm fuzzy feeling just grew and grew. Whenever I’d have to work with Java, it was painful. I’d find myself rushing through it and making stupid mistakes because I had more important Kotlin files to attend to. But when I opened the Kotlin files, I felt at home, relaxed. The code was beautiful and expressive. It was concise but powerful. I kept finding new ways to write more clearly, more directly. And I was happy!
And so that’s where we’re at in the love story. It’s still really early, and who knows if this is just infatuation or true love. For all I know it’ll all come crumbling down. But no matter how it turns out, I learned this very valuable lesson (and it only took me 15+ years)…
Nobody can truly decipher a programming language‘s greatness for you. No amount of explanation will help you feel a great language at your fingertips. They may try, but it won’t fully click. You have to experience it for yourself.
If you’re programming now, but don’t love the language you’re writing, I’d encourage you to try one that has a reputation for positive vibes: Ruby, Kotlin, Swift, or Coffeescript. And don’t just read the docs and do tutorials — pick one and try building something real.