[swift-evolution] SE-0105: Removing Where Clauses from For-In Loops

Xiaodi Wu xiaodi.wu at gmail.com
Fri Jun 24 16:14:34 CDT 2016


On Fri, Jun 24, 2016 at 4:04 PM, Jose Cheyo Jimenez <cheyo at masters3d.com>
wrote:

>
>
> On Jun 24, 2016, at 11:30 AM, Xiaodi Wu via swift-evolution <
> swift-evolution at swift.org> wrote:
>
> On Fri, Jun 24, 2016 at 6:37 AM, William Shipley <wjs at mac.com> wrote:
>
>> On Jun 23, 2016, at 11:04 PM, Xiaodi Wu <xiaodi.wu at gmail.com> wrote:
>>
>>
>> Not a practitioner of 80-character line limits, I take it?
>>
>>
>> I don’t understand why anyone wouldn’t just let Xcode do the wrapping for
>> most cases. I’ll add newlines if I think it adds to clarity, but in general
>> I don’t want to code like i’m still on a Wyse WY-50.
>>
>
> Of course, to each their own style--I certainly wouldn't want Swift to
> force everyone to write lines of certain lengths.
>
>
> The fact that you bring up a style in a proposal review [about a style
> imo] (and thus distracting the review process ) just reinforces the
> thinking that the proposal is about enforcing a particular style.
>

On the contrary, new data have been presented on how `where` is being used.
These raise a point that `where` promotes a particular style over others,
and what I'm trying to point out here--not mentioned previously--is that
one purported major benefit of `where` (putting everything on one line) is
inapplicable to the Swift stdlib's own style as well as those of others. It
is not a distraction to tackle new points that are brought up during the
review process.


> I think you made your point clearly in the discussions and proposal.
> Please allow other people to have their own opinions in this review :),
> otherwise it is not a review imo.
>

You may note that I've confined my comments to particulars raised by
others' comments. And, FWIW, I haven't actually reviewed the proposal, so
I'm not sure how you know how I feel about it.


> But 80-character lines is a common style, and I would say that a corollary
> of "to each their own" is that Swift's grammar should be usable and useful
> whether or not you adhere to such style choices.
>
> If the chief advantage of `where` is that it (quoting someone above)
> allows one to "understand as much as possible about the control flow of
> the loop from a single line of code," then we ought perhaps to question its
> appropriateness when the majority of its benefits [by which I mean, based
> on your examples and Sean's, more than half of the instances in which it is
> used] cannot be realized in a very common coding style.
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160624/149d244a/attachment.html>


More information about the swift-evolution mailing list