I read that the main raison is the syntax that doesn’t fit with the language paradigm.
Kotlin and Swift share the same language paradigm (secure by construction). In Swift they had implemented this syntax in early versionb (previously to 2). But they removed ‘variable++’ syntax as it is off of the language paradigm… so it became evident to have to remove the traditional C for-loop syntax. So Swift 3 lost it.
Looking at usage we are far more iterating with a step of 1 than other, and far more iterating before the count/size of an array than other. So we wrote far more ‘i < size; i++’ that other. And because we are iterating a lot for array iterations, the for-in-array became the more used construction.
As says @GeorgePap-719 for the main need of iterating a defined numeric sequence, the syntax with range (half-open) is very more simple AND READABLE.
0..<size, 1..<size, n..<m
The new version will also adopte what that existed in swift the range including the end (closed-range).
0..size, 1..(size+1)
The reverse side if far more explicit than C like version
size downTo 1
And the stepping is very explicit also
1..<size step 2
Note also that the original C syntax included the possibility of:
1- implementation in line because so in (int i = 0 ; i < n ; i++) the var ‘i’ is not a constant varying under the hood but a true mutable one, so you can change it during the loop that is bug generating.
2- as it was implementation it supported the syntax ‘variable++’ but also "variable–', ‘++variable’ and ‘–variable’ that was a source of readability complexity, and needed to implement the ‘++variable’ & ‘–variable’ in the language to be predictive with the C syntax, that was a risked syntax.
(int i = 0 ; i == n ; ++i) << 'i' is iterated before being considered
so what happens really here?
(int i = 0 ; i == n ; i++) << is it different from the previous syntax?
3- multi-member, multi test, multi implementation syntax that could lead to very complexe syntax
(int i = 0, int j = -1, z = i ; j < i, i < n, z > j; i++, ++j)
even thought we wrote that a lot for sorts, matrix journeys we have to recognize that we spend an enough important time to consider (and debug) what was the intent here and figure out the variation.
So on my side when it turns for me to write C++, I avoid this kind of loop and prefer to keep simple if I must use it.