Maintaining poor legacy code, interpreting cryptic comments, and writing the same boilerplate over and over can suck the joy out of your life as a Java developer. Fear not! There's hope! Kotlin is an elegant JVM language with modern features and easy integration with Java. The Joy of Kotlin teaches you practical techniques to improve abstraction and design, to write comprehensible code, and to build maintainable bug-free applications.
Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.
About the Technology
Your programming language should be expressive, safe, flexible, and intuitive, and Kotlin checks all the boxes! This elegant JVM language integrates seamlessly with Java, and makes it a breeze to switch between OO and functional styles of programming. It's also fully supported by Google as a first-class Android language. Master the powerful techniques in this unique book, and you'll be able to take on new challenges with increased confidence and skill.
About the Book
The Joy of Kotlin teaches you to write comprehensible, easy-to-maintain, safe programs with Kotlin. In this expert guide, seasoned engineer Pierre-Yves Saumont teaches you to approach common programming challenges with a fresh, FP-inspired perspective. As you work through the many examples, you'll dive deep into handling errors and data properly, managing state, and taking advantage of laziness. The author's down-to-earth examples and experience-driven insights will make you a better—and more joyful—developer!
What's inside
About the Reader
Written for intermediate Java or Kotlin developers.
About the Author
Pierre-Yves Saumont is a senior software engineer at Alcatel-Submarine Networks. He's the author of Functional Programming in Java (Manning, 2017).
The book title is a bit misleading. It should be "Functional programming in kotlin" as the book follows structure and content of "Functional programming in Java" and "Functional programming in scala" from the same publisher.
I might be biased, but out of those 3 (fp in scala, java, kotlin), I've enjoyed scala version the best. Perhaps because scala is truly function programming language, while kotlin is more"pragmatic java" kind of a deal, which coincidentally makes it more functional.
You should expect basics of functional programming from this book: pure functions, persistent data structures, lazy evaluations, folds, recursion and corecursion, etc. The books tries to be very gentle and slow with introduction of new concepts (and doesn't use category theory language), but requires you to do a lot (and i mean "A LOT") of exercises. If you're not familiar with functional programming I highly recommend doing it. On the other hand, if you did your homework with SICP, i don't think this book will be enlightening in any way (while "functional programming in scala" by Rúnar Bjarnason might still be lots of fun and discoveries)
As with all books in this series, you might end up being lost at the end. "I got it how to make my code more functional, but how is this applicable to my day job?" For those folks a i would recommend "Domain Modeling Made Functional: Tackle Software Complexity with Domain-Driven Design and F#" by Scott Wlaschin and "Functional and Reactive Domain Modeling" by Debasish Ghosh.
I've read this via Manning's Early Access Program and it is a fun, brief read. It is a bit like O'Reiily's "X: The Good Parts" series. Even though I read the more complete guide first (Kotlin in Action)., this was a good reinforcement of many things from that book.
This book is not about Kotlin, it’s about functional programming. Hence, if you want to learn the language you’ll likely feel confused as various syntax elements and concepts are introduced without proper introduction.
It’s better if you expect to learn about functional programming, but still far from perfect (in my opinion). First few chapters - focused on core and more advanced concepts of this paradigm - are the best (especially part dedicated to recursion/corecursion and about handling errors and optional data). Unfortunately it gets worse once we get to data handling. The examples feel very academical and detached from the real world. I think it would be much better if the book showed how functional programming can be practically applied and how it makes our code safer and better rather on focusing on guiding readers on how to implement various data structures in “safe” manner.
Overall I think it’s a decent read for someone who wants to learn about concepts of functional programming and doesn’t mind that most of the examples and exercises feel like something that needs to be implemented to pass “Data Structures in Functional Programming” course at the university.
Better title would be "Functional Programming with Kotlin". The book focuses on evangelizing functional programing, and only incidentally covers Kotlin as its selected tool for FP. After the first several chapters, I only skimmed the balance to confirm that's what it was about.
For all I know, it could be a five-star book on FP, but that's not how it's titled and marketed. As a book on Kotlin, as the title "The Joy of Kotlin" suggests, it is -- at best -- a two-star book.
If you want to learn FP, this may be the book for you. If you want to learn Kotlin.... nope.
A book suitable to someone who is just beginning to write code, and knows no Kotlin. After the first hundred pages you've explored most of the language. Much of the examples tries to shoehorn FP-concepts into a language where FP isn't a first class citizen. For a novice it's a good introduction to FP-concepts however. The code quality isn't that great either, mostly due to the contrived FP flavor. I would not be happy to get a new colleague who really took these examples to their heart. FP fits better in for example Haskell. It feels like it tries to be a Kotlin version of FP in scala - the red book.