Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Marcin Moskala

Rating No ratings yet

Effective Kotlin summarizes the best practices and experiences of the Kotlin community, together with a deep explanation of some lesser-known Kotlin functionalities. All of the best practices are presented as simple rules with detailed explanations. 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. The purpose of this book: To really unleash the advantages of Kotlin, we need to use it properly. Knowing features and the standard library (stdlib) is not enough. The main goal of this book is to explain how to use different Kotlin features to achieve safe, readable, scalable, and efficient code. Since this book is written to help developers get better at writing code, it also touches on many general rules for programmers. You can find the influence of programming classics like Clean Code, Effective Java, Structure and Implementation of Computer Programs, Code Complete, and many more. You can also find influence from presentations and Kotlin forums. This book tries to compose as much knowledge about best practices in Kotlin as possible, no matter where it originated. You can call it a collection of best practices; though it differs from classic “Effective X” books because of Kotlin characteristics. The Effective Java book contains many warnings about internal Java problems. In Kotlin such problems are mostly eliminated by the Kotlin team. In contrast to Java, Kotlin is not worried about deprecating something and fixing it in the future. In the worst case, the Kotlin team controls a powerful IDE that can do nearly any migration to a better alternative. For whom is this book written? This book is not

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

Brief outline
【One-Line Pitch】 Effective Kotlin summarizes the best practices and experiences of the Kotlin community, together with a deep explanat… 【Book Arc】 - **Opening (~0%–12%)**: All of the best practices are presented as simple rules with detailed explanations.; to be collected in books or articles because they can just be provided via discrete warnings exactly where they are needed. - **Early (~12%–35%)**: 8, 9, 10, 11, 12] Stop now and try to explain this result.; If they are not satisfied, the function throws an exception instead of leading to unexpected behavior. - **Middle (~35%–65%)**: (separator separator) When should we use named arguments?; Let’s say that we have two indepen- dent Android applications in the same project. - **Late (~65%–88%)**: • @since - Specifies the version of the software in which the element being documented was introduced.; First of all, because it breaks Item 12: Use operator methods according to their names. - **Ending (~88%–100%)**: 30 31 val properSet List(10000) { Proper(" it") }.toSet() 32 println(Proper.equalsCounter) // 0 3…; 8 } Chapter 7: Make it cheap 351 is really fast, but it can add-up when we need to operate on a huge pool of objects. 【Key Takeaways】 - **All of the best practi…** (Opening): All of the best practices are presented as simple rules with detailed explanations. - **to be collected in boo…** (Opening): to be collected in books or articles because they can just be provided via discrete warnings exactly where they are needed. - **ce the element is changed** (Opening): ce the element is changed, we need to sort this list again. - **8, 9, 10, 11, 12] Stop…** (Early): 8, 9, 10, 11, 12] Stop now and try to explain this result. - **If they are not satisfied** (Early): If they are not satisfied, the function throws an exception instead of leading to unexpected behavior. - **ult or a sealed result…** (Early): ult or a sealed result class is returned. 【Reading Tips】 - Use Passage locations below to jump into the text and set reading anchors - If this is a brief outline, click Regenerate (top right) for a synthesized guide 【Coverage Limits】 Compressed outline without the model (~33 index chunks). Full structured guide needs AI available.
Excerpt 1
ied about deprecating something and fixing it in the future. In the worst case, the Kotlin team controls a powerful IDE that can do nearly any migration to a...
View in text
Excerpt 2
If they are not satisfied, the function throws an exception instead of leading to unexpected behavior. It is important that these exceptions are thrown befor...
View in text
Excerpt 3
? Go back and think about it now. Chapter 2: Readability 99 The meaning of each operator in Kotlin always stays the same. This is a very important design dec...
View in text
Excerpt 4
as well as a context (this). The reference to the property is most often used to get its name, and sometimes to get information about annotations. Context gi...
View in text
Excerpt 5
What we need is a more abstract method to display a message. Having that in mind, a programmer could hide toast display behind a higher-level function showMe...
View in text
Excerpt 6
more complex objects or a hierarchical structure of objects. They are not easy to define, but once they are defined they hide boilerplate and complexity, and...
View in text
Excerpt 7
For instance, someone might want to make a Time object that represents the current time, and compares milliseconds: Chapter 6: Class design 322 a network cal...
View in text
Excerpt 8
Error 3 // ... 4 } 5 6 private class Reader { 7 // ... 8 } This is why they cannot be used to hide implementation, and so they are rarely used in classes. Fi...
View in text
Tags
AI categories
Java
Publisher: Leanpub
Publish Year: 2021
Language: English
Pages: 439
File Format: PDF
File Size: 9.7 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…