<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Ted,<div class=""><br class=""></div><div class="">I don't think many of us that are active on this mailing list had the opportunity to provide feedback on this proposal review. I very much agree with you on many points that you bring up below. I have spent a lot of time scratching my head wondering why it was so important to remove certain syntax from Swift, such as C-style loops, unary increment, and unary decrement. Leaving them there increases compatibility of C code with Swift, and leaving them there keeps them opt-in. If you don't want to use it, you don't have to. However, the changes definitely force developers to use newer syntax, which runs contrary to the "opt-in philosophy" that the core team has impressed on the community.</div><div class=""><br class=""></div><div class="">I'm going to play devil's advocate though. Will the tools for Swift 3 automatically make the necessary changes to source to comply with the new syntax? If so, is it so bad? I've been using the C language and all of its variants for more than 32 years. Hence, it is easier on my eyes and brain if there is some compatibility there. Personally, I think leaving this syntax in the language eases migration. Although, I've been learning so many new languages over the last decade that it seems to matter less with time. However, I can't seem for the millions of developers that write code for OS X and iOS.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">-Patrick</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 18, 2016, at 4:28 PM, Ted F.A. van Gaalen via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">As most colleagues (that's what I think you all are, spanning two generations :o)&nbsp;</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">might have noticed, I am not exactly happy with the removal of the classical&nbsp;</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">for-loop &nbsp; ( for ;; )&nbsp; but the damage has been done, so I will soon&nbsp;</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">present a proposal for a better alternative. Working on it.</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">I find this matter very important.</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">I do not agree with the for-loop removal proposal authored by Erica Sadun,</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">Important:&nbsp;</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">I would like to emphasize again that what I write is not intended personally.&nbsp;</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">Also I realize that I am a bit late on this subject, but that is because I was not here back then.</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">I wil go through it point by point and try to explain why IMHO I think this is not a good proposal.&nbsp;</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">---------------------</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">Evaluating proposal SE-0007</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">Remove C-style for-loops with conditions and incrementers</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>•<span class="Apple-tab-span" style="white-space:pre">        </span>Proposal:<span class="Apple-tab-span" style="white-space:pre">        </span>•<span class="Apple-tab-span" style="white-space:pre">        </span>Author(s): Erica Sadun</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><b class=""></b><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><b class=""></b><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">"The C-style for-loop appears to be a mechanical carry-over from C rather than a genuinely Swift-specific construct."</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">Could you explain to me why what, in your view, is&nbsp;</span></div><div style="margin: 0px; line-height: normal;" class=""><font color="#0433ff" style="font-size: 12px;" class=""><span style="-webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class="">&nbsp; &nbsp; - &nbsp;a "genuinely Swift-specific construct</span><span style="-webkit-text-stroke-color: rgb(4, 51, 255);" class="">”</span><span style="-webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class="">&nbsp;?</span></font></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class=""><span style="-webkit-text-stroke-width: initial;" class="">&nbsp; &nbsp; - "not very Swift-like" ?</span><span style="-webkit-text-stroke-width: initial;" class="">&nbsp;&nbsp;</span></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class=""><span style="-webkit-text-stroke-width: initial;" class="">- "Swift-typical</span>”<span style="-webkit-text-stroke-width: initial;" class="">&nbsp;?</span></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">"It is rarely used&nbsp; and not very Swift-like."</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">This is definitely not true.&nbsp;</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">The classical for loop is one of the most frequently used language constructs in most programming languages.</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">"More Swift-typical construction is already available with for-in statements and stride."&nbsp;</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">Except for collections, these are inconvenient, cumbersome and inefficient&nbsp; "work arounds" as described later in my comments in this email.</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">"Removing for loops would simplify the language."</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">Removing screw drivers from a toolbox would indeed simplify the toolbox.</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">So would removing closures, classes, protocols etc. from Swift.</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">Simplification of a programming language can also have its disadvantages.&nbsp;</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">"&nbsp;And starve the most common use-points for -- and ++, which are already due to be eliminated from the language."</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">"The value of this construct is limited and I believe its removal should be seriously considered"</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">There absolutely is no need to remove the for ; ; and also ++ -- from the language. These can perfectly well co-exist with other language elements of Swift. If you don't want to use them, that's fine, but for most people out there who still want to use the for ;; and ++ -- . &nbsp;</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">"Swift design supported a shallow learning curve using familiar constants and control structures.&nbsp;</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">The for-loop mimics C and limits the effort needed to master this control flow."</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">Yes indeed. It mimics C and also the for-loop or its equivalent in more that 20 other programming languages.</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><b style="font-size: 12px;" class="">"Disadvantages of For Loops</b></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-size: 12px;" class=""><font style="-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>1<span class="Apple-tab-span" style="white-space:pre">        </span>Both for-in and stride provide equivalent behavior using Swift-coherent approaches without being tied to legacy terminology</font>”</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">Most language elements in Swift ARE legacy, and that's ok, so one does not have to re-invent the wheel again. &nbsp; <span style="-webkit-text-stroke-color: rgb(0, 0, 0);" class="">&nbsp; &nbsp;</span></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>"2<span class="Apple-tab-span" style="white-space:pre">        </span>There is a distinct expressive disadvantage in using for-loops compared to for-in in succinctness"</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">What makes you think so?&nbsp;</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-size: 12px;" class=""><font style="-webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>"3<span class="Apple-tab-span" style="white-space:pre">        </span>for-loop implementations do not lend themselves to use with collections and other core Swift types.</font>”</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">Agreed if it concerns collections.&nbsp; However, they can.&nbsp; Of course, it is much easier and more readable to use&nbsp; e.g. 'for item in items" for collections.</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">Please enlighten me:&nbsp; what "other core-Swift-types" do you refer to?&nbsp;</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>"4<span class="Apple-tab-span" style="white-space:pre">        </span>The for-loop encourages use of unary incrementors and decrementors, which will be soon removed from the language."</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">Although the majority of programmers like the ++ and -- operators, I do manage to understand why some do not like it. However ++ and -- are very well suited for classical for-loops, in fact they even make them more readable... Like so:</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">&nbsp;1.&nbsp; for i = 0;&nbsp; i &lt;&nbsp; iterations; &nbsp; &nbsp; i++&nbsp; { ...}</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">or&nbsp;</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">&nbsp; 2. for i = 0;&nbsp; i &lt;&nbsp; iterations; &nbsp; &nbsp; i +=&nbsp; 1 { ...}</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">It looks like the first example is more readable.&nbsp; But yes, if it were that the ++ -- would have remained in Swift, and also the classical for-loop,&nbsp; using ++ and -- should probably restricted to be used in for-loops only.&nbsp;</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>"5<span class="Apple-tab-span" style="white-space:pre">        </span>The semi-colon delimited declaration offers a steep learning curve from users arriving from non C-like languages."</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">IMHO, this is utter nonsense. Even from those coming from other languages as C++, C, if a mere three arguments separated by two semicolons are "a steep learning curve" ? Then what to think about using closures, lambda's, classes, inheritance, functional programming, protocols etc. ?</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><b class=""></b><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><b style="font-size: 12px;" class="">"Impact on existing code</b></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">A search of the Apple Swift codebase suggests this feature is rarely used."</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">A search of the Apple Swift codebase is not representative, because the scope of this search encompasses only source code made by users of the programming language Swift, which is partly still under further development. Faithfully representative would it be to search in a wider perspective, which should include source code written in variety of programming languages like Objective-C, Java, C#, C++, C, PHP , Ruby, Go, Perl, Javascript, Dart, V. Basic, Pascal,&nbsp; PL/1, Cobol, Rexx. Most of this languages have implemented the for-loop (or equivalent) . Undoubtedly if one would do a search for for-loop in these languages it would become clear that the for-loop is heavily used. &nbsp;</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">As a result of removing the classical for loop it is to be expected that lot of people might consider thinking twice about switching to Swift, If they have to live without (or cumbersome work around) language elements that have proven to be very useful for at least a few decades...</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">How do you arrive at such a conclusion? In this perspective, Erica, I am very much interested to know if you have practical experience with using other programming languages than Objective C and Swift. Have you built solid applications with other systems, IDEs and languages? Also, did you consult programmers working with other well established languages?&nbsp;</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">"Community members of the Swift-Evolution mail list confirm that it does not feature in many pro-level apps and can be worked around for those few times when for-loops do pop up."</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">If one browses through the App Store, one might notice that most apps work with collections&nbsp;<span style="-webkit-text-stroke-width: initial;" class="">(e.g. customers, addresses, shopping items, videos, songs. etc.) For these kind of applications, the for-in-collection statement in Swift is great and well catering for these requirements. The result of this is, that the majority of Swift developers will not be aware and not miss the classical for-loop (or a new Swift equivalent for it at all)</span><span style="-webkit-text-stroke-width: initial;" class="">&nbsp; </span><span style="-webkit-text-stroke-width: initial;" class="">simply because they do not need it.</span></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">However, for those that make scientific, engineering, statistical, technical and game apps, the lack of a simple but versatile iteration statement, which in most cases can be compiled down to a simple and very fast assembler loop is nothing less than a disaster.</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">E.g. For the purpose of performance testing, in an Apple TV SceneKit app I am currently building,&nbsp;<span style="-webkit-text-stroke-width: initial;" class="">I did replace replace the classical for-loop by a "for in x.stride(..."</span><span style="-webkit-text-stroke-width: initial;" class="">&nbsp; </span><span style="-webkit-text-stroke-width: initial;" class="">for coordinate calculations.&nbsp;</span><span style="-webkit-text-stroke-width: initial;" class="">Performance dropped to about 45%, this is unacceptable.</span><span style="-webkit-text-stroke-width: initial;" class="">&nbsp; </span><span style="-webkit-text-stroke-width: initial;" class="">The compiler cannot get rid of this. Working with a collection based for-in will nearly always be twice as slow, for the simple reason that the contents of the collection it has to process are by definition unpredictable.</span><span style="-webkit-text-stroke-width: initial;" class="">&nbsp; &nbsp;</span></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">In your proposal you offered the following example. I do not know where you found this horrible piece of code. However, in this case it is not the for-loop that is so bad, but the complete function. There are many better and well structured classical for-loops to be found everywhere. I cannot deflect my impression that you might have selected this particularly bad example solely to amplify your proposal's case.&nbsp;</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class="">"</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">char *blk_xor(char *dst, const char *src, size_t len)</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">{</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">&nbsp;const char *sp = src;</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">&nbsp;for (char *dp = dst; sp - src &lt; len; sp++, dp++)</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">&nbsp;&nbsp; *dp ^= *sp;</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">&nbsp;return dst;</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">}</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class="">"</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">Again, this is a extremely bad C Example, infested with (at least to me) unclear pointer usage. (Luckily in Swift there are (or should be) no pointers) Somewhere in this messy example, yes, a for-loop can be found. Notice that the for-loop itself is relatively simple and straightforward. Also, the fact that this for-loop deploys two value incrementors instead of one, is in this particular context not really all that bad. &nbsp;</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">In my opinion, the Swift equivalent you offer, does not look much better:</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class="">"</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">func blk_xor(dst: UnsafeMutablePointer&lt;CChar&gt;, src:</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">UnsafePointer&lt;CChar&gt;, len: Int) -&gt; UnsafeMutablePointer&lt;CChar&gt; {</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">&nbsp;&nbsp; for i in 0..&lt;len {</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">&nbsp;&nbsp; &nbsp; &nbsp; dst[i] ^= src[i]</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">&nbsp;&nbsp; }</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">&nbsp;&nbsp; return dst</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">}</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">A search of github's Swift gists suggests the approach is used primarily by those new to the language with minimal language skills and is abandoned as language mastery is achieved.</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class="">"</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">Another subjective assumption and almost insulting for those, often with years of experience, who deploy the classical for-loop intensively and really knowing what they are doing.</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">My conclusion:</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">Although the proposal has been accepted. I would like to see it withdrawn&nbsp;</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">because the arguments brought forward are highly subjective,&nbsp;</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">not thoroughly analyzed and in some cases even false.&nbsp;</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">Furthermore, a proposal should be based on facts, not assumptions.&nbsp;</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">Kind Regards</span></div><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255); -webkit-text-stroke-color: rgb(4, 51, 255); -webkit-text-stroke-width: initial;" class=""><span style="font-size: 12px;" class="">TedvG.</span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><span style="font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; -webkit-text-stroke-color: rgb(0, 0, 0); -webkit-text-stroke-width: initial; min-height: 13px;" class=""><br class=""></div></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></body></html>