Why should we prefer to avoid throwing exceptions and using types to our advantage. Read and learn f...
k
Why should we prefer to avoid throwing exceptions and using types to our advantage. Read and learn from the article written by @marcinmoskala https://kt.academy/article/ek-nullable-result This is a chapter from the Effective Kotlin book. You can find it on LeanPub https://leanpub.com/effectivekotlin
o
has there only ever been 1 edition of this book? since 2020?
or what’s the latest one
m
the 1st edition still valid until today, I can confirm, just bought it (2 weeks ago)
🙂 1
m
Nice article. I also wanted to add that you should generally prefer
null
over
Result
when you have exactly one reason to fail such as most stdlib extension functions (
firstOrNull
,
getOrNull
...etc), either the item is there in the collection or not there, there is no third possibility. But, when you've possibly multiple sources of errors, you should go with
Result
option
k
Hi guys, well we are currently working on the 2nd edition. It should be available at the beginning of 2023.
@MR3Y I am forwarding it to @marcinmoskala.He will reply best.
m
The book is updated over time. We can do that, because we base on ebooks LeanPub distribution and KDP. There was a major update recently. I plan to add two more items soon and then announce the second edition.
p
Hey Marcin, quick question: Is the electronic copy updatable, at least per edition or you need to re-purchase it. I bought the paper copy in Amazon, edition 1. I love the paper ones cause I can mark it and it is a bit more comfortable to read but I gotta keep buying it all the time. I mean I have no problem with that.
k
@marcinmoskala - will reply ASAP
m
If you buy on LeanPub, you can always download the most recent version. I do not know how does it work on Amazon.
👍 1