Add Kotlin Coding Guideline

This commit is contained in:
Martin Blazik
2020-09-30 08:23:05 +02:00
parent 4bb5570ae8
commit 1d6912c580

View File

@@ -0,0 +1,27 @@
### `value.?let` or `if (value != null)`
Is really better to use
```kotlin
value?.let {
// some block
}
```
then
```kotlin
if (value != null) {
// some block
}
```
There is no return value so block is NOT expression.
### Don't use anonymous class implementation
```kotlin
val value = object : Type {
// implementation
}
```