> On Oct 14, 2016, at 12:59 PM, Chris Lattner <[email protected]> wrote:
> 
>       
> https://github.com/apple/swift-evolution/blob/master/proposals/0144-allow-single-dollar-sign-as-valid-identifier.md

>       * What is your evaluation of the proposal?

I know this is cutting against the grain, but I'm in favor.

I don't think the Dollar library is a good design, but I think there *are* good 
designs which could use an extremely short, distinctive identifier like `$`. 
These would be cases where there is a single, specific object, operation, or 
type which is absolutely central to the problem domain. jQuery is a good 
example of this: it is used in browsers, where DOM manipulation is such a big 
part of what you're doing that an extremely shorthanded syntax is appropriate. 
Other examples might include parsing or generating strings. In general, 
anything where a Swift file is effectively "embedded" or acting as a "plugin" 
might benefit from `$`.

Certainly that is not most Swift code, but this is a harmless change when you 
don't need it, and a helpful change when you do. And certainly code using it 
may be a little sloppy unless there's preprocessing involved, but sometimes a 
sloppy solution is the most expressive one.

>       * Is the problem being addressed significant enough to warrant a change 
> to Swift?

Maybe. It certainly is possible to design around it by switching to a single 
identifier character, but few of those stand out in the same way `$` does.

>       * Does this proposal fit well with the feel and direction of Swift?

I think it does. Swift disfavors boilerplate, and the places I imagine `$` 
ought to be used are those where a longer name would introduce unacceptable 
amounts of boilerplate.

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

`$` is certainly a rather popular identifier in Javascript.

>       * How much effort did you put into your review? A glance, a quick 
> reading, or an in-depth study?

Not much more than a glance.

-- 
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to