Kotlin Design Patterns and Best Practices - Second Edition: Build scalable applications using traditional, reactive, and concurrent design patterns in Kotlin
S**L
A Great Book that Discusses the Interesting Parts of Kotlin while also Teaching Design Patterns
"Kotlin Design Patterns and Best Practices" is a book that covers three major topics: design patterns, commonly-used Kotlin language features, and applications of patterns and language features by designing concurrent and reactive microservices. Currently, I work as an Android programmer. The Android platform uses Kotlin as its flagship programming language, which has convinced me to do a deep-dive on the language and its advanced features, which led me to this book. Because of this book, I have a greater understanding of fundamental Kotlin, the Kotlin language's best features, and how to more effectively write and use Kotlin in my Android apps.This book features many different design patterns, which are very important to learn as you become a more senior software engineer. Proper understanding and application of design patterns allows you to more-effectively structure your code, and communicate your code's intent to other engineers. Because of this, many engineers dedicate time and effort to learning these patterns, making this book a fantastic resource. This book shows examples of each pattern in Kotlin, as well as hypothetical examples of where you might apply a given pattern, which can make this book a great reference on design patterns.While I was reading this, it became very apparent that the designers of the Kotlin language selected keywords for the language to more effectively communicate a given keyword's pattern application. For example, the "object" keyword aligns with the Singleton pattern in the book, where no such exclusive keyword exists in Kotlin's parent language of Java. What this means for readers of this book is that the examples shown in the book are relatively concise and easy to understand. Because of this language design decision, and the multiple design decisions made for the Kotlin language, I can think of no better language to teach and communicate design patterns.The second major focus of this book is on the Kotlin language's features, including its features for functional programming, multithreading, and reasoning around nullability. Kotlin provides more-advanced language features around handling nullability, similar to languages like Go. This helps combat nullability errors, which are a common pain point for developers. The book covers how Kotlin handles nullability, and how you can properly structure your code with nullability in mind, with things like the let function. This nullability concept is a common pain-point among developers, so I find it nice that this book makes strong mention of how to combat this.This book also covers the functional programming techniques and methods that the Kotlin language supports. Most languages still in use today have some form of functional programming available, but Kotlin holds its own by comparison. One thing that I learned was how you could use the "also" function to show intermediate effects in a function chain without having to break the function chain. I haven't seen this in other languages, though it may exist in them. Either way, the book makes special mention of it, and I can think of a few places where it might be useful in some of my projects.This book also covers the multithreading and parallelism aspects of the Kotlin language, which are supported to great effect with things like coroutines, observers, subscribers, and locks. These concepts are very important in Android in particular because all data processing and network requests in Android must take place off of the main thread. This means that any asynchronous app, which is almost all of them, makes use of these features. In my onboarding as an Android developer, this was a point of pain to learn, but this book has really helped iron these concepts out in my mind. I will probably need to review this section a bit more to more fully understand what is happening, but I am significantly better off reading this book to understand these concepts.The last section of the book goes over how to apply the first two sections of the book to produce concurrent and reactive microservices. I used to work as a web developer, so I would occasionally work on back-end projects. Going through these microservice sections, it was nice to see some of the earlier parts of the book applied. Furthermore, it was nice to see an example of how to implement APIs in Kotlin first-hand.Luckily, I found few spelling and grammar errors in this book. It was edited well, structured thoughtfully, and written to be useful. I expect that this will be a book that I keep close by throughout all my time working as an Android developer. My overall rating of this book is 4.5 out of 5. I think that the book is a very, very relevant book for Kotlin programmers and Android developers of all skill levels. I have only two criticisms for the book. The first would be that as approachable as the book is, novice developers will have trouble understanding the section of the book on concurrency: concurrency is an advanced topic that can be somewhat difficult for people to reason about, particularly if a given reader has little exposure to the topic beforehand. My second criticism is that the section about microservices at the end comes up a little bit abruptly and could probably go through some fleshing out. Coming from a prior webdev background, I had little issue interfacing with the API I was writing, but new developers may run into issues interfacing with the API. Also, since this section relies on external things like IntelliJ IDEA and its plugins, the screenshots for this section with respect to the IntelliJ IDEA editor are recently out of date with what's shown in new versions of IntelliJ IDEA.Overall, this is a great book that I'll keep by my side mostly to reference the different Kotlin design patterns and language features. I expect that I'll be referencing it regularly as these patterns and features come up in my work.
P**R
Fun examples in simple terms but technically sound and efficient.
To me, 5 stars is perfect and hardly most things are. But 4 is still excellent.I have been coding and reviewing Java for 25+ years and started my Kotlin journey 4 years ago. I code Kotlin part-time nowadays and this book served as an excellent refresher as well as updater on the critical fundamentals of Kotlin language syntax, design, and best practices presented in a natural flow.As not all the many intricate aspects of Kotlin were presented up front, detours to provide examples and explore Kotlin language features were strategically placed -- like the Elvis operator or the by keyword.As a visual learner, I feel it could have used more diagrams like illustrations or UML to supplement explanations of concepts, like the Adapter pattern to show relationships among USB and plug types example. Adding tables would also help to summarize patterns and when to best use them. Although, I could probably enhance my own methods of retaining knowledge by drawing out such pictures and charts on my own.This book is great for learning Kotlin with some background in Java although not necessary and little need for previous design pattern knowledge. Overall written with fun examples in simple terms but technically sound and efficient when describing concepts.
B**N
Great source to start using Kotlin or refresh your knowledge every year
I have 10 years of experience working with Java and now Im catching up with its best friend, Kotlin. I have used it professionally for the last year and this book has an incredible collection of useful language concepts and patterns that every engineer using Koltin should read at least once a year.Before reading this book you should already be familiar with basic programming concepts and with the paradigm of Object-Oriented Programming.
C**G
Physical print formatting style for code :thumbs down:
The content is fine and I appreciated the levity and tone of the authors voice. If you’re familiar with design patterns then this will be an easy read, my biggest complaint is with the highlighted code. I don’t know who approved the final print but the code is formatted such that it font black, background grey with spacing between lines that is white! It’s extremely challenging to read in low light, so b warned.
J**Z
Muy buen libro
Contiene ejemplos que se pueden bajar de github y que funcionan.
A**S
Best kotlin book
Very good and deep knowledges
A**E
Humorvoll und anschaulich, ohne unnötig viele Details
Ideal als "Zweitbuch", wenn man schon etwas Kotlin-Kenntnisse und auch schon mal was von Design-Patterns gehört hat. Diese beiden Aspekte werden hier in sehr prägnantem Stil zusammengebracht.Die Anwendungsbeispiele sind oft mit einem Augenzwinkern präsentiert, was den Stoff auflockert und gut im Gedächtnis bleibt. Und sie sind vor allem, ähnlich wie Kotlin-Code, sehr knapp gehalten, ohne unnötigen Ballast.Entsprechend gelingt es dem Autor, sehr viele Patterns und insbesondere auch reaktive und funktionale Denkweisen in einem handlichen 300-Seiten Buch unterzubringen.Einziger Kritikpunkt ist die Darstellung der Codebeispiele: Ohne Farbe und mit scharzer Schrift auf grauem(!) Hintergrund... da fragt man sich als Entwickler schon, ob man überhaupt noch ein gedrucktes Buch braucht.
P**R
Good book
It helps you understanding core of Kotlin and how actually things works inside in some cases.It helps me in cracking Walmart
H**A
awesome read!
awesome read! very useful.
Trustpilot
1 month ago
3 weeks ago