diff --git a/info/guide/guide-chapter-3.md b/info/guide/guide-chapter-3.md index b305e8c290..46922aaeea 100644 --- a/info/guide/guide-chapter-3.md +++ b/info/guide/guide-chapter-3.md @@ -1185,6 +1185,24 @@ if (condition1 && condition2 && condition1) { } ``` + +### 3.17 Ranges +This section describes guidelines for working with ranges. + +#### 3.17.1 +When creating a range with excluded upper boundary, instead of using range function with included upper boundary (`rangeTo` or `..`) +it's preferred to use a range function with excluded upper boundary (`until`). +Invalid example: +```kotlin +0..(a-1) +``` +Valid example: +```kotlin +0 until a +``` + +Instead of `rangeTo` function it's preferred to use `..` operator. + ### 3.18 Logging This section describes the general rules of logging.