Dirk Dittert (1) [Avatar] Offline

here are a couple of things I noticed while reading through the EAP books. I hope they're still current because they are from one of the previous EAPs.

section 7.4:
destructuring with component() functions requires the operator keyword. It is missing in the examples.

Page 165:
+= is coming a couple of pages later. When reading that section, I was wondering about how += would be handled. Maybe a reference to the later pages could help. Also: it would be nice to make it clearer, when to override + and when += (and how those two play together).

Page 133:
JetBrains address is not correct in code example smilie

Page 128:
Regarding Double: that's a little tricky because you could have NaN for double as well.

Section 5.5/Page 128
It would be nice if there were more information/comparison with Java 8 (lamdas, streams/sequences; more than that short box Streams vs. Sequences). How do you handle Java Collections properly in Kotlin?
I think it was this section that also mentioned "pre Java 8" a couple of times. I know that that was probably meant as something positive for Android developers, but the association I got was more like "oh, this book was written pre Java 8 (which was released quite some time ago)".

Just a couple of thoughts smilie
Dmitry Jemerov (39) [Avatar] Offline
Hi Dirk,

Thanks for your feedback! Regarding the individual notes:

1) Fixed
2) I've looked at the text again, and I don't think a forward reference to += would fit in with the flow.
3) I think that's intentional. smilie Don't want people to see code examples as a source of truth about the real world.
4) My understanding is that any operation which has NaN as one of its arguments will simply produce a NaN as its result. I think it falls under the definition of "execute succesfully".
5) The reason why we don't say anything about Java 8 streams is that right now their use in Kotlin looks very ugly (you have to cast a variable to java.util.Collection). This is planned to be addressed fairly soon, and once we have a better solution, we'll update the text to describe this. As for the lambdas, what kind of comparison would you like to see?