- Kotlin Standard Functions cheat-sheet
- Jose Alcerreca
- The Nuggets translation Project
- Permanent link to this article: github.com/xitu/gold-m…
- Translator: Feximin
- Proofread by: Phxnirvana
Last week I tweeted about the new contents of Kotlin’s standard method cheat sheet, and I found them to be better than traditional methods. Instead of focusing on how each method works, it provides guidance based on what the developer wants to achieve:
Download Kotlin standard method flowchart in PNG or PDF format.
The flowchart is advisory: every decision is made for a reason, from semantics to readability. For example, while Apply can have side effects, it is more readable and secure to use it in a separate method.
The flowchart is not exhaustive: there are other use cases not covered. For example, while run can be used to limit scope, it is best to extract it into a method.
This flowchart is not yet complete: it will be updated as programming languages evolve and patterns emerge.
I also provided the traditional table:
Download the Kotlin standard method form in PNG or PDF format.
Links:
- Making the warehouse
Thanks to everyone who contributed to this chart and session
If you find any mistakes in your translation or other areas that need to be improved, you are welcome to the Nuggets Translation Program to revise and PR your translation, and you can also get the corresponding reward points. The permanent link to this article at the beginning of this article is the MarkDown link to this article on GitHub.
The Nuggets Translation Project is a community that translates quality Internet technical articles from English sharing articles on nuggets. The content covers Android, iOS, front-end, back-end, blockchain, products, design, artificial intelligence and other fields. If you want to see more high-quality translation, please continue to pay attention to the Translation plan of Digging Gold, the official Weibo, Zhihu column.