SE-0439: Allow trailing comma in comma-separated lists

For me, there is a fundamental difference between the Dictionary/Array case and the proposal we have here. The difference to me comes down to:

  1. Dictionary/Array can have an arbitrary number of elements, that are likely to change/grow over time. For the cases proposed here, adding elements to functions/initializers/subscripts/etc is a structural change: its signature changes. This for me is counter intuitive: I expect these to remain mostly stable, whereas the trailing comma signifies either that it'll probably change or I forgot something.
  2. While adding elements to a Dictionary/Array keeps the type the same, adding elements to a tuple changes its type.
  3. Ambiguity for consumers of an API. What does this mean: Vector2D(x: 1, y: 2,) or Vector3D(x: 1, y: 2, z: 3,) ?
    So to summarize: the trailing comma in the cases suggested by the proposal signals "more to come" for me, whereas for these cases I expect stability. This is different from the Array/Dictionary cases.

As for the proposal:

  • What is your evaluation of the proposal?
    -1

  • Is the problem being addressed significant enough to warrant a change to Swift?
    I do see that this solves a need - in particular quickly commenting in/out of lines. But for me this issue is not big enough when I compare it to how I anticipate tripping over this feature. Especially as the consumer of an APIs.

  • Does this proposal fit well with the feel and direction of Swift?
    I don't think it fits very well: it helps make a specific actions easier (i.e. commenting in/out lines) while sacrificing clarity and signaling intent.

  • If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
    No

  • How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
    Quick reading, in particular the examples.

9 Likes