Kotlin guidelines next rulez
This commit is contained in:
@@ -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)`
|
### `value.?let` or `if (value != null)`
|
||||||
|
|
||||||
Is really better to use
|
Is really better to use
|
||||||
@@ -24,4 +43,3 @@ val value = object : Type {
|
|||||||
// implementation
|
// implementation
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user