September 2019
Intermediate to advanced
462 pages
11h 3m
English
Programmers with experience in Java and other C-like languages are used to external iterators. They are common but complex; we’re very familiar with them, but they involve many moving parts. Internal iterators are less familiar to a lot of programmers, but they are less complex than external iterators.
External iterators in Kotlin are already an improvement when compared to external iterators in Java, but even then, the internal iterators have much less ceremony, are more concise, and are expressive when compared to Kotlin’s external iterators. Let’s compare Kotlin’s external iterators with internal iterators using some examples.
Here’s a list of numbers stored in a numbers variable:
| | val ... |
Read now
Unlock full access