- Proposal: TBD
- Author: Erica Sadun
- Status: TBD
- Review manager: TBD
This proposal adopts consistent conjoined keyword lowercasing.
Swift-evolution thread: RFC: didset and willset
Swift is an opinionated language. One opinion it adheres to is that keywords should
use conjoined lowercasing. Conjoined lowercase terms already in the language include typealias
,
associatedtype
, and fallthrough
. Using this casing style enables programmers to treat
keywords as atomic concepts. This proposal formalizes this rule and fixes current inconsistencies.
This proposal addresses the first of the following Swift casing rules:
- Keywords use lower case conjoined naming.
- Attributes use lower camel cased naming.
- Attributes use “non” prefixes in preference to "no" prefixes.
- Compiler-expanded literals use lower camel casing and are prefixed with octothorpes (
#
) - Swift eschews snake casing. (See also: SE-0028)
- Terms of art may be exempted from casing rules.
- Phrases sourced from outside Swift may be exempted from Swift casing rules, e.g.
@UIApplicationMain
.
This proposal is part of a series that will:
- Normalize casing to lower conjoined names.
- Normalize naming for "negative" attributes (from "noFeature" to "nonfeaturing").
- Move dynamicType to the standard library as a global function.
Upon adoption, Swift will rename didSet
and willSet
to willset
and didset
.
Future expansions to the language will follow this adopted rule, for example didchange
.
This proposal deliberately omits the dynamicType
keyword, which will be addressed
under separate cover: to be moved to the standard library as a standalone global function.
This proposal requires migrator support, renaming keywords using the old convention to adopt the new convention. It is a simple substitution that should offer limited effect.
I recommend deprecating the old keywords in Swift 2.3 and removing them in Swift 3.
Not adopting this rule for Swift.