Why was the indexed for loop removed in Kotlin?

It was not "removed". The design of a new language doesn't start with the feature set of any existing language; we start with a language that has no features, and start adding features which are necessary to express certain behavior in a nice and idiomatic way. Up until now, we aren't aware of any behavior for which a C-style 'for' loop would be the nicest and most idiomatic way to express it.


The answer is: because they decided to remove it. You can still use this syntax:

for (a in 1..10) print("$a ")              // >>> 1 2 3 4 5 6 7 8 9 10

for (a in 10 downTo 1 step 2) print("$a ") // >>> 10 8 6 4 2 

For more info: Ranges & Loops