Kotlin Design Patterns and Best Practices by Alexey Soshin / Packt - First impressions review
Despite having no professional programming experience (yet) and having mostly programmed with Python, when I got an opportunity to get an early review copy of 3rd edition of Alexey Soshin’s book in exchange for a little review, I decided to jump in. Kotlin is enticing after all: it’s a bit functional and it targets the JVM!
Design Patterns -tag in the book’s title almost sells the book short as the book is about much more than just the classic Gang of Four methods. After launching with Kotlin fundamentals recap, the book is in (roughly) equal parts about the classical design patterns (Section 1), functional and concurrent patterns (Section 2) and practical applications of all of them (Section 3).
The Kotlin fundamentals -part has a specific approach of comparing Kotlin’s syntax to Java. Java comparisons don’t necessarily feel helpful for a person with most experience with Python, but they do make me appreciate Kotlin’s more concise syntax. For me, the most interesting part of this section were the serious considerations about immutability. Kotlin has strong ties to two worlds, OOP because of connection to Java and functional paradigm because of languages philosophy and this shows in the approach.
The classic Gang of Four design patterns are examined in the book thoroughly and with good examples. As expected, specific Kotlin methods are described in conjunction with use of each design pattern. Alexey Soshin has clearly worked with each of the design patterns in order to break through levels of abstraction which easily make programming concepts feel disconnected from reality. I am no expert in using design patterns, but this section seems solid and worth studying with an actual project at hand.
Section 2 starts with a practical observation that functional programming patterns are particularly adept at handling parallel tasks. I think this is a good take and it’s a smart idea to learn using immutable structures and other functional programming tools from the start when learning parallel and concurrent programming. Multithreaded design is explained with practical examples of potential pitfalls such as heavy memory usage and slow processes when concurrency is not sufficient. One chapter is dedicated to enhancing coroutines with reactive principles, higher-order functions and concurrent data structures. Concurrent design patterns explored in this section include: deferred value, barrier, scheduler, pipeline, fan-out, fan-in, racing, mutex and sidekick.
Section 3 dives deep into idioms and anti-patterns as well few specific libraries. Functional library Arrow gets its own chapter as well as more hands-on chapters with Ktor and Vert.x. Book ends with Assessments -chapter which presents FAQ of topics presented in the book.
All in all the book seems to be a well thought out exploration into its topics!
Review of Kotlin Design Patterns and Best Practices by Alexey Soshin - Third Edition
I recently had the chance to review "Kotlin Design Patterns and Best Practices - Third Edition", and I wanted to share my thoughts on it.
Disclaimer: I received a review copy of this book without any cost to me.
Here's my review of reading this book:
1. The book introduces Kotlin from basic to advanced levels, 2. The code snippets are highlighted with colors, making the reading experience more engaging and less monotonous, 3. It covers popular design patterns, 4. English is my second language, but the book is written in an easy-to-understand language.