Always use let for case statements

Disagree, FWIW. A name binding had important semantic meaning for me as a reader, and I wouldn't want to dilute it with irrelevant cases.

On Sat, Oct 11, 2014 at 7:38 PM, Justin Spahr-Summers
<notifications@github.com> wrote:

>> +
>> +#### Always use `let` for `case` statements
>> +
>> +In `case` statements, always destructure values using `let`, even if there are no arguments:
>> +
>> +```swift
>> +switch (someOptional) {
>> +case let .Some(value):
>> +	println(value)
>> +
>> +case let .None:
>> +	println("No value")
>> +}
>> +```
>> +
>> +_Rationale:_ This ensures consistency between cases, makes it easy to change the pattern matching later, and avoids mutable variables.
>> In that it makes different things look the same.
> Each case is a pattern match and a destructuring. They're the same thing, regardless of whether there are bound identifiers.
>> How so?
> I meant in terms of `let` vs. `var` for this purpose.
>> My take is: use `let` only when you’re actually wanting to bind variables. Otherwise it makes it look like you are, which is confusing.
> In other languages with pattern matching, there's no difference between a match that binds identifiers and one that simply matches.
> I don't think there's any semantic difference in Swift either, so ultimately the choice is purely aesthetic to me. I find it easier to scan multiple `case` statements if they all start the same way. Missing `let`s just distract me, they don't communicate any useful information.
> I'd be interested to hear @joshaber and @andymatuschak's (if I may) opinions on this too.
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/github/swift-style-guide/pull/13/files#r18745398