From f8b6812990647d1cee4126b8b21ca64d431c473b Mon Sep 17 00:00:00 2001 From: Martin Blazik Date: Wed, 30 Sep 2020 16:17:29 +0200 Subject: [PATCH] Kotlin guidelines next rulez --- doc/kotlin-coding-guideline.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/doc/kotlin-coding-guideline.md b/doc/kotlin-coding-guideline.md index ec2f70c..13979fa 100644 --- a/doc/kotlin-coding-guideline.md +++ b/doc/kotlin-coding-guideline.md @@ -1,3 +1,22 @@ +# Kotlin Coding Guidelines + +## Code structure + +- short methods (not too long) + - add suggestion how to refactor + +- only one level of abstraction + keep only one abstraction level in method + +- keep low level of identation + less is more + for example when() if-else if-else is not very good redable + +- use variable for expression / condition + + +## Questions + ### `value.?let` or `if (value != null)` Is really better to use @@ -24,4 +43,3 @@ val value = object : Type { // implementation } ``` -