fun Shop.getSetOfCustomers(): Set<Customer> = TODO()
is just plain bad kotlin.
h
Hullaballoonatic
11/02/2019, 7:41 PM
do you mean because it's better to write as:
Copy code
val Shop.customers get() = setOf(...)
?
Hullaballoonatic
11/02/2019, 7:43 PM
If so, keep in mind this is tutorial. They're trying to help people learn the language fundamentals, and the official kotlin style of doing it would add an extra layer of confusion
Hullaballoonatic
11/02/2019, 7:43 PM
styling code is bottom of priority when learning a language
☝️ 1
Hullaballoonatic
11/02/2019, 7:44 PM
also the name implies the answer is
setOf(customers)
, which is incorrect. A python user might assume that is the way, and they need to learn how casting is done in Kotlin