Proposal for Replacing Keyword "subscript" with "subs"‏


(Feijian Sun) #1

Hello, I have a proposal to replace the long keyword "subscript" with the shorter version, "subs". The idea is to keep the concise naming style on the language keywords, like "init" and "func".So, Instead of:subscript(index: Int) -> Int { ... ...}we could simply do:subs(index: Int) -> Int{ ... ...}Does this mean a big change on the parser side? what do you think?Thank you!


(Jack Lawrence) #2

It’s non-obvious to me that “subs” is short for subscript, whereas “init” and “func” have only one obvious expansion.

Jack

···

On Dec 10, 2015, at 6:12 PM, Feijian Sun via swift-evolution <swift-evolution@swift.org> wrote:

Hello,

I have a proposal to replace the long keyword "subscript" with the shorter version, "subs". The idea is to keep the concise naming style on the language keywords, like "init" and "func".

So, Instead of:

subscript(index: Int) -> Int {
        ... ...
}

we could simply do:

subs(index: Int) -> Int{
        ... ...
}

Does this mean a big change on the parser side? what do you think?

Thank you!
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org <mailto:swift-evolution@swift.org>
https://lists.swift.org/mailman/listinfo/swift-evolution


(Chris Lattner) #3

Hi Feijian,

I agree with Jack in this case that we should keep "subscript". Swift's rough approach to keywords is:

1) reuse contracted keywords that are widely known in the C family when the connotations are obvious (e.g. struct, enum, etc).
2) contract some “new” keywords for the *most commonly occurring* situations (e.g. func/var, though var is precedented in a number of extended c family languages like javascript), because people are expected to be forced to learn these things in the first few days of their swift learning.
3) otherwise, use a full word (subscript, convenience, mutating, etc).

In the case of subscript, it doesn’t occur often enough to be worth forcing people to memorize, and thus we prefer obvious clarity in the situations when it occurs in code.

-Chris

···

On Dec 10, 2015, at 6:12 PM, Feijian Sun via swift-evolution <swift-evolution@swift.org> wrote:

Hello,

I have a proposal to replace the long keyword "subscript" with the shorter version, "subs". The idea is to keep the concise naming style on the language keywords, like "init" and "func".

So, Instead of:

subscript(index: Int) -> Int {
        ... ...
}

we could simply do:

subs(index: Int) -> Int{
        ... ...
}

Does this mean a big change on the parser side? what do you think?


(Feijian Sun) #4

Thank you for responding so late!
I agree with you that "subs" is not very obvious for subscript. While learning swift, I have a feeling that it contains so many long words as the keywords, such as
fallthrough, dynamicType, associativity, convenience, nonmutating, precedence, etc..
I understand there is a need for clarity. But I think it's also important to keep a concise and simple naming style where it's possible.
Thanks again.

···

Subject: Re: [swift-evolution] Proposal for Replacing Keyword "subscript" with "subs"‏
From: jackl@apple.com
Date: Thu, 10 Dec 2015 18:22:55 -0800
CC: swift-evolution@swift.org
To: feijian_sun@hotmail.com

It’s non-obvious to me that “subs” is short for subscript, whereas “init” and “func” have only one obvious expansion.
Jack
On Dec 10, 2015, at 6:12 PM, Feijian Sun via swift-evolution <swift-evolution@swift.org> wrote:Hello, I have a proposal to replace the long keyword "subscript" with the shorter version, "subs". The idea is to keep the concise naming style on the language keywords, like "init" and "func".So, Instead of:subscript(index: Int) -> Int { ... ...}we could simply do:subs(index: Int) -> Int{ ... ...}Does this mean a big change on the parser side? what do you think?Thank you! _______________________________________________swift-evolution mailing listswift-evolution@swift.orghttps://lists.swift.org/mailman/listinfo/swift-evolution


(Feijian Sun) #5

Okay, I see your points. Thanks for response!

···

Subject: Re: [swift-evolution] Proposal for Replacing Keyword "subscript" with "subs"‏
From: clattner@apple.com
Date: Thu, 10 Dec 2015 21:06:52 -0800
CC: swift-evolution@swift.org
To: feijian_sun@hotmail.com

On Dec 10, 2015, at 6:12 PM, Feijian Sun via swift-evolution <swift-evolution@swift.org> wrote:Hello, I have a proposal to replace the long keyword "subscript" with the shorter version, "subs". The idea is to keep the concise naming style on the language keywords, like "init" and "func".So, Instead of:subscript(index: Int) -> Int { ... ...}we could simply do:subs(index: Int) -> Int{ ... ...}Does this mean a big change on the parser side? what do you think?
Hi Feijian,
I agree with Jack in this case that we should keep "subscript". Swift's rough approach to keywords is:
1) reuse contracted keywords that are widely known in the C family when the connotations are obvious (e.g. struct, enum, etc). 2) contract some “new” keywords for the *most commonly occurring* situations (e.g. func/var, though var is precedented in a number of extended c family languages like javascript), because people are expected to be forced to learn these things in the first few days of their swift learning.3) otherwise, use a full word (subscript, convenience, mutating, etc).
In the case of subscript, it doesn’t occur often enough to be worth forcing people to memorize, and thus we prefer obvious clarity in the situations when it occurs in code.
-Chris


(ilya) #6

Functional programming style brings us a lot of joy, so the most important
keyword shortening to support is obviously func -> fun.

···

On Fri, Dec 11, 2015 at 08:06 Chris Lattner via swift-evolution < swift-evolution@swift.org> wrote:

On Dec 10, 2015, at 6:12 PM, Feijian Sun via swift-evolution < > swift-evolution@swift.org> wrote:

Hello,

I have a proposal to replace the long keyword "subscript" with the shorter
version, "subs". The idea is to keep the concise naming style on the
language keywords, like "init" and "func".

So, Instead of:

subscript(index: Int) -> Int {
        ... ...
}

we could simply do:

subs(index: Int) -> Int{
        ... ...
}

Does this mean a big change on the parser side? what do you think?

Hi Feijian,

I agree with Jack in this case that we should keep "subscript". Swift's
rough approach to keywords is:

1) reuse contracted keywords that are widely known in the C family when
the connotations are obvious (e.g. struct, enum, etc).
2) contract some “new” keywords for the *most commonly occurring*
situations (e.g. func/var, though var is precedented in a number of
extended c family languages like javascript), because people are expected
to be forced to learn these things in the first few days of their swift
learning.
3) otherwise, use a full word (subscript, convenience, mutating, etc).

In the case of subscript, it doesn’t occur often enough to be worth
forcing people to memorize, and thus we prefer obvious clarity in the
situations when it occurs in code.

-Chris

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution


(Feijian Sun) #7

Interesting idea and I like it myself.
My idea of shortening the long keywords in swift came up when I was typing swift code using a simple text editor. Without the help from the auto-complete feature in xcode, I was really feeling the pain. Considering that the swift has been port to linux platforms and many developers now have chances to code swift with none-xcode editors on linux, they could feel the same pain like I did.
But I see Chris's points in his response email. Following the 3 point approach to keywords, it's clear that we should keep "subscript".
Thanks,
Feijian

···

From: ilya.nikokoshev@gmail.com
Date: Fri, 11 Dec 2015 12:18:26 +0000
Subject: Re: [swift-evolution] Proposal for Replacing Keyword "subscript" with "subs"
To: clattner@apple.com; feijian_sun@hotmail.com
CC: swift-evolution@swift.org

Functional programming style brings us a lot of joy, so the most important keyword shortening to support is obviously func -> fun.
On Fri, Dec 11, 2015 at 08:06 Chris Lattner via swift-evolution <swift-evolution@swift.org> wrote:
On Dec 10, 2015, at 6:12 PM, Feijian Sun via swift-evolution <swift-evolution@swift.org> wrote:
Hello, I have a proposal to replace the long keyword "subscript" with the shorter version, "subs". The idea is to keep the concise naming style on the language keywords, like "init" and "func".So, Instead of:subscript(index: Int) -> Int { ... ...}we could simply do:subs(index: Int) -> Int{ ... ...}Does this mean a big change on the parser side? what do you think?
Hi Feijian,
I agree with Jack in this case that we should keep "subscript". Swift's rough approach to keywords is:
1) reuse contracted keywords that are widely known in the C family when the connotations are obvious (e.g. struct, enum, etc). 2) contract some “new” keywords for the *most commonly occurring* situations (e.g. func/var, though var is precedented in a number of extended c family languages like javascript), because people are expected to be forced to learn these things in the first few days of their swift learning.3) otherwise, use a full word (subscript, convenience, mutating, etc).
In the case of subscript, it doesn’t occur often enough to be worth forcing people to memorize, and thus we prefer obvious clarity in the situations when it occurs in code.
-Chris

_______________________________________________

swift-evolution mailing list

swift-evolution@swift.org

https://lists.swift.org/mailman/listinfo/swift-evolution