Kotlin is a powerful and pragmatic language, but it's not enough to know about its features. We also need to know when they should be used and in what way. This book is a guide for Kotlin developers on how to become excellent Kotlin developers. It presents and explains in-depth the best practices for Kotlin development. Each item is presented as a clear rule of thumb, supported by detailed explanations and practical examples.
Marcin Moskała Bücher






Projektanci Kotlina postawili na pragmatyzm. Oznacza to, że do dziś wszystkie decyzje związane z rozwojem języka są podejmowane z uwzględnieniem potrzeb biznesowych: produktywności, skalowalności, prostej konserwacji, niezawodności i wydajności. Od początku szczególną uwagę zwraca się również na bezpieczeństwo, czytelność, wielokrotne używanie kodu, łatwość użycia narzędzi i możliwości współdziałania z innymi językami. Bardzo ważna okazała się też wydajność zarówno działania kodu, jak i pracy programisty. Konsekwentne przestrzeganie tych założeń dało znakomite efekty. Dziś Kotlin jest świetnym wyborem dla programisty - pod jednym warunkiem: że zna specyfikę języka i korzysta z niego we właściwy sposób. Ta książka jest przeznaczona dla doświadczonych programistów Kotlina, którzy chcą opanować ten język na wysokim poziomie. Wyjaśniono w niej sposoby korzystania ze szczególnych funkcji Kotlina, aby możliwe było uzyskanie bezpiecznego, czytelnego, skalowalnego i wydajnego kodu. Znalazły się w niej informacje o najlepszych praktykach pisania kodu w Kotlinie ze szczególnym uwzględnieniem praktyk wysokiego poziomu, zalecanych przez autorytety i twórców języka. Wyczerpująco omówiono też kwestie związane z właściwościami i typami specyficznymi dla platformy oraz tworzenie języków dziedzinowych, a także klasy i funkcje wewnątrzwierszowe. Jest to praktyczny przewodnik zawierający zbiór wytycznych, których uwzględnienie pozwoli pisać dobry i idiomatyczny kod w Kotlinie. W tej książce między innymi: reguły pisania kodu o wysokiej jakości programowanie dla różnych platform oraz aplikacje mobilne wzorce i konwencje programistyczne konwencje i kontrakty dla programistów wspólnie tworzących projekt zapewnianie wysokiej wydajności aplikacji i bibliotek Kotlin: wydajność, bezpieczeństwo, radość z programowania!
You know how to use Kotlin, but do you know the advanced features? What are the consequences of using variance modifiers? What limitations do they introduce, and how can these be overcome? How does property delegation work? How to use reflection? How to implement a KSP or an annotation processor? How is a Kotlin Compiler Plugin implemented? If you want to know the answers to these questions, this book is for you. This book focuses on the advanced aspects of Kotlin's development. These are often features and tools that developers use daily, even though they dont know exactly how they work. This book explains them and gives you the knowledge to use these features in your projects. WHO IS THIS BOOK FOR? This book is for developers with Kotlin experience who want to learn about its advanced features. Readers are expected to have experience in Kotlin development. All the required knowledge can be discovered in the books Kotlin Essentials and Functional Kotlin. WHAT IS COVERED? This book focuses on advanced Kotlin features, including: Generic variance modifiers Interface and property delegation Kotlin Contracts Kotlin and Java interoperability Multiplatform development Using Kotlin/JS Kotlin reflection Annotation Processor Kotlin Symbol Processor Kotlin Compiler Plugins Static Analysis with custom rules
Kotlin is a powerful language that has transformed Android and backend development, offering robust support for functional programming. Its features, such as functional collection processing, DSL builders, scope functions, and context receivers, enable developers to achieve intuitive and expressive functional syntax. The language's extensibility allows libraries like Arrow to enhance functional styles while maintaining type safety, stability, and performance. This book delves into Kotlin's functional programming features, starting with the essentials and progressing to advanced topics. Key subjects include collection processing, function references, scope functions, DSL usage and creation, and context receivers. Ideal for developers familiar with Kotlin basics, this book serves as a natural continuation of Kotlin Essentials, requiring no prior math knowledge. Topics covered encompass generic variance modifiers, interface delegation, custom property delegates, Kotlin contracts, and Java interoperability. It also explores multiplatform development, including library implementation and shared modules for Android and iOS applications, Kotlin/JS essentials, and custom annotation processing. The book features numerous example projects, such as a type-safe task update class, logging property delegates, and a random value generator for generic types. Additionally, it includes practical implementations of annotation processors and
Kotlin is a powerful language, largely thanks to its expressive syntax, intuitive and null-safe type system, and great tooling support. Its no wonder that Kotlin is the most popular language for Android development and is a popular replacement for Java on backend applications. It is also used for data science and for multiplatform, iOS, desktop, and web application development.
Kotlin Coroutines. Deep Dive 2nd ed
- 342 Seiten
- 12 Lesestunden
Kotlin coroutines have transformed JVM development, particularly for Android and backend applications, by enabling efficient and reliable multithreading. This book delves into the workings of Kotlin coroutines and demonstrates how to enhance applications using built-in support and the kotlinx.coroutines library. With a practical approach, it emphasizes real-life use cases and provides examples throughout. As this technology gains traction in Android and backend development, the book highlights best practices for its implementation. Targeted at Kotlin developers eager to grasp Kotlin Coroutines for real-world projects, the content primarily addresses backend and Android scenarios while also offering insights applicable to other platforms. The book is structured into three parts: 1. Understanding Kotlin Coroutines – an introduction to the fundamentals and mechanics of coroutines. 2. Kotlin Coroutines Library – an exploration of key concepts from the kotlinx.coroutines library and effective usage. 3. Channel and Flow – a detailed look at Channel and Flow from the kotlinx.coroutines library. Based on a workshop experience, the book focuses on topics that have sparked the most interest among attendees, including the inner workings of coroutines, practical applications, best practices, and testing methodologies, as well as an explanation of Flow and its functionality.