I think there are some parts of stdlib where it's arguably inconsistent - e.g.
isEmpty()
- but lots of parts of Kotlin pre-date the modern style document
✅ 2
y
Youssef Shoaib [MOD]
05/24/2022, 11:07 PM
I was attempting to justify in my mind why
isEmpty
would be a method, but nope I can't find any reason. It doesn't do any expensive or long computation in the case of normal collections (just a size check) or Iterables/Sequences (just a
hasNext
) check. Sure, hasNext theoretically could be "expensive", but I don't think that justifies it.
... wait, why isn't hasNext a property? 🤦