• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

FP in Ken's Kotlin Cookbook?

 
Ranch Hand
Posts: 149
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Ken,

How would you represent your book to an average CS student, by average I mean a student with solid understanding of OOP concepts in Java, who wishes to enter a world of Android programming?
Also, I would be really grateful If you could explain how did you represent usage of FP in your book? More specifically, how did you explain usage of lambda expressions and creating custom functional interfaces? After thorough reading of this book on lambdas and streams,how would that fit into FP in Android, in your book ?

Greetings from Serbia
 
gunslinger & author
Posts: 169
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mike (from Connecticut in the US),

The Android world is in a bit of flux right now. Originally apps were written in Java, with Activities, Fragments, and so on instantiated and configured directly. Now the preferred language is Kotlin, and a lot of people are moving to more of a component model. The so-called "jetpack" components are used for navigation, mapping to databases, and more.

I love the Head First Android Development book as a learning tool for Android, but unfortunately it is still in Java. The concepts are great, though. There is also a "Big Nerd Ranch Guide to Android", and the latest edition uses Kotlin. My book is more general than just Android, but has some Android examples in it.

Regarding functional programming, the book you linked to has a newer edition, called Modern Java in Action, but the streams, lambdas, and method references work the same way. I illustrated the similar concepts in Kotlin. For example, Kotlin collections have functions like map and filter, and Kotlin sequences are essentially Java streams. Concepts like "higher order functions" are just library calls that take lambdas as arguments, and aren't much different from their counterparts in Java (like forEach taking a Consumer).

In other words, I think you'd find my book straightforward. If not, feel free to ask questions here, or contact me directly.
 
Ranch Hand
Posts: 122
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Ken has provided lots of example on FP more specifically on Lamdas & Stream in his other book Modern Java Recipes Solutions its a interesting read,give it a try..
 
There will be plenty of time to discuss your objections when and if you return. The cargo is this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic