• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Head First Kotlin: What are the differences in terms of common frameworks?

 
Ranch Hand
Posts: 51
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A question about the common frameworks in Java & Kotlin.

What are the differences of Kotlin's lambdas, collections, generics to the Java counterparts?
There are such differences apart from syntax?

 
Author
Posts: 105
5
Android Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Jorge,

You will find that all of the stuff you can do in Java, you can do in Kotlin. But there are a whole bunch of new things that are available in Kotlin. Initially, a lot of Kotlin really relied upon the structures in Java. That's easy to do, because Kotlin on the JVM can run anything that Java can. So all of the collection types could be used, because you just needed to import things from java.util. But this limited the code that could be recompiled to other platforms (such as JavaScript), so over time the Kotlin developers have been creating more Kotlin-y ways of doing stuff. So in the Kotlin standard library you will find things like "Comparable" that will seem strangely familiar. In this way, Kotlin is steadily building its own platform-independent stack that will allow you to (for example) more easily port your Java libraries into modules that could be used in the client Java application.

Also, Kotlin has some much more advanced features that are easily done in Java. They have co-variant and contra-variant generics. Co-routines. It can use the more modern idioms that JavaScript developers have had available for years. If you start to learn Kotlin, you will find a *lot* that is very familiar. But you will also find some wonderful new tools that will allow you to create more flexible and solid code.

Thanks for the question.

D+D
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!