Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Kotlin Cookbook

 
Ranch Hand
Posts: 515
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi,

I've written a couple Android apps that use Java because that is my background . Other than Google wanting to phase out Java and  force people to use Kotlin , is there a compelling reason to learn the language? My understanding is that Google created Kotlin because of an ongoing business dispute with Oracle .

From what I've read ,the performance issues  with Android (as compared with IOS) have more to do with the fundamentals of the Android OS  rather than the language that apps are written in. What I read said the Android performance issues had to do with Android treating all app threads with equal priority but  IOS allows apps to have different thread priorities so IOS apps are more responsive. I could be wrong but that was my understanding of the article/post I read.

While your book is about a language ,it would be interesting to get your perspective on the Android OS performance issues as well .

Thanks,
Paul
 
gunslinger & author
Posts: 158
11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Whether Google favors Kotlin over Java because of its series of lawsuits with Oracle is always a matter of some debate. That probably contributed, but I don't think that's the only or even the biggest reason. The developer community was already in the process of adopting Kotlin for Android development, mostly because:

* Null-safety is a highly valued feature of the language
* Kotlin has inline functions, which keeps the total function count down (a significant issue in larger Android apps)
* Kotlin does some optimizing on size and space
* Kotlin is produced by JetBrains, which is the same company behind both IntelliJ IDEA and Android Studio, so the IDE integration is very good.

When Google announced back in 2017 that they were going to support Kotlin for Android apps, some people felt they were just acknowledging a move in the developer community that was already underway. Still, they did jump on it, and now everything is "Kotlin First" at Google when creating a new library.

Threading wasn't a major part of Kotlin at the beginning, but the development of coroutines and structured concurrency have made it easier to write Android apps that move off and back onto the UI thread as needed. I agree that I don't think performance is related as much to the language as to the platform itself, so the move to Kotlin doesn't really change performance all that much. That said, it's easier to get the threading right with Kotlin, which is a minimum requirement.
 
paul nisset
Ranch Hand
Posts: 515
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Kenneth.
Making thing easier to move off of the Main UI is probably the reason to switch  that I find most compelling but the other reasons you listed are good as well.

 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic