408399 (15) [Avatar] Offline
#1
Some 'when' is explained in terms of 'if', but the technical explanation of 'if' does not begin until subsection 2.3.4 on page 32.

Please re-sequence the text sections, to explain how 'if' works, before discussing something which builds upon the simple form.
Svetlana Isakova (9) [Avatar] Offline
#2
We assume that the reader knows how if works in Java (or in any other language). Before 2.3.4 we use the Java form, and at the beginning of 2.3.4, we show an example with if returning a value. We mention it earlier in 2.1.3 as well.
408399 (15) [Avatar] Offline
#3
Agreed, the reader should know how 'if' works in some other language, very probably Java.

But the small mentions of using a statement as an operator (or as a function, I think) are easily glossed over, and do not lead the reader to really consider this unusual concept.

The book doesn't really go into it until 2.3.4.

So I recommend fully presenting the concept at its first mention, perhaps in a box, so the reader can begin to grasp one of Kotlin's fundamental differences earlier, and will be less likely to misinterpret other text.