<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">I prefer camelCase but if it's inconsistent to the current Swift then I guess a review is needed. I would like to add though that a small change of letter case that will break Swift just because it feels inconsistent is a bit over the top. It needs to be reviewed properly.<br />
<br />
I'm also against removing it completely. didSet/willSet can be helpful the same as viewWillAppear/viewDidAppear.</div>
<div name="messageSignatureSection"><br /></div>
<div name="messageReplySection"><br />
On 19 May 2016, 9:44 AM +0800, Ricardo Parada via swift-evolution &lt;swift-evolution@swift.org&gt;, wrote:<br />
<blockquote type="cite">I like them camelCase.<br />
<br />
<blockquote type="cite">On May 18, 2016, at 4:58 PM, Erica Sadun via swift-evolution &lt;swift-evolution@swift.org&gt; wrote:<br />
<br />
<br />
<blockquote type="cite">On May 18, 2016, at 2:56 PM, Krystof Vasa &lt;kvasa@icloud.com&gt; wrote:<br />
<br />
Not to mention @NSApplicationMain, @NSManaged, ...<br />
<br />
I'd personally keep it camelCase.<br /></blockquote>
<br />
Those are sourced external to Swift.<br />
<br />
<blockquote type="cite">
<blockquote type="cite">On May 18, 2016, at 10:53 PM, Erica Sadun via swift-evolution &lt;swift-evolution@swift.org&gt; wrote:<br />
<br />
Just some context:<br />
<br />
"We have a few conjoined keywords already (typealias, associatedtype, fallthrough). In the discussion about these terms, we decided that these read best when all lowercase, because they are treated as atomic concepts by programmers"<br />
<br />
and<br />
<br />
"On it being a conjoined word, we agreed that the language is currently inconsistent (we have typealias, fallthrough, but also didSet/willSet and @warn_unused_result) and that we should clean it up. Conjoined feels like the right direction to go for this case. We didn’t discuss it but IMO, didSet should get lowercased as well."<br />
<br />
-- E<br />
<br />
<br />
<blockquote type="cite">On May 18, 2016, at 2:50 PM, Sean Heber &lt;sean@fifthace.com&gt; wrote:<br />
<br />
+1 on not getting rid of willSet and didSet for sure!<br />
<br />
As for naming, it doesn’t bother me much either way, but I think lowercase makes sense with the direction everything else is going.<br />
<br />
l8r<br />
Sean<br />
<br />
<br />
<blockquote type="cite">On May 18, 2016, at 3:38 PM, Michael Peternell via swift-evolution &lt;swift-evolution@swift.org&gt; wrote:<br />
<br />
Hi Erica,<br />
<br />
"didset" and "willset" are outliers in the general rule that when combining multiple words into an identifier, that you should use camelCase. which rule is more important? I'd like to introduce a third rule: don't fix it if it isn't broken, or more mildly: if in doubt, keep it the way it is. or another one: embrace precedent.. "@IBOutlet" is also not all-lowercase, should it be changed too? I'd say no, because in objc it is called "IBOutlet" as well. Also, for my Apple Mail client, "didset" and "willset" are marked as typos, but "didSet" and "willSet" is okay :)<br />
<br />
=&gt; I vote for "didSet" and "willSet".<br />
<br />
I think we should be more careful when trying to argue with "consistency". It sounds objective, when in reality it's often very subjective, because Immanuel Kant's imperative is ambiguous ;) there are multiple ways to be consistent. If you are saying that something is inconsistent, you either assert a specific rule of consistency (like "keywords are always lowercase"), or you must argue that there is no general/sane rule under which the individual parts of the system are consistent.<br />
<br />
And for all the others who want to abolish didSet and willSet completely:<br />
NO WAY! they are both useful and I even used them for real code. For example, from code in my bachelors thesis (it's about polygons):<br />
<br />
public var points: Array&lt;CGPoint&gt; = [] {<br />
didSet {<br />
_area = nil<br />
_centroid = nil<br />
}<br />
}<br />
<br />
I want to cache the _area and _centroid of a polygon, because I'm going to use it many many times more often than I change points. I would have to rewrite that code to something like<br />
<br />
private var _points: Array&lt;CGPoint&gt; = []<br />
public var points {<br />
get {<br />
return _points<br />
}<br />
set {<br />
_area = nil<br />
_centroid = nil<br />
_points = newValue<br />
}<br />
}<br />
<br />
That's not better, and it probably breaks the COW-optimization of the underlying array. (And don't tell me that my design is bad because I use "didSet", I really don't think so.)<br />
<br />
-Michael<br />
<br />
<blockquote type="cite">Am 18.05.2016 um 17:09 schrieb Erica Sadun via swift-evolution &lt;swift-evolution@swift.org&gt;:<br />
<br />
didSet and willSet remain outliers in the general rule of conjoined lowercase keywords. Is there any support for bringing these outliers into the fold?<br />
<br />
-- E, going through her "ttd notes" this morning<br />
<br />
_______________________________________________<br />
swift-evolution mailing list<br />
swift-evolution@swift.org<br />
https://lists.swift.org/mailman/listinfo/swift-evolution<br /></blockquote>
<br />
_______________________________________________<br />
swift-evolution mailing list<br />
swift-evolution@swift.org<br />
https://lists.swift.org/mailman/listinfo/swift-evolution<br /></blockquote>
</blockquote>
<br />
_______________________________________________<br />
swift-evolution mailing list<br />
swift-evolution@swift.org<br />
https://lists.swift.org/mailman/listinfo/swift-evolution<br /></blockquote>
</blockquote>
<br />
_______________________________________________<br />
swift-evolution mailing list<br />
swift-evolution@swift.org<br />
https://lists.swift.org/mailman/listinfo/swift-evolution<br /></blockquote>
_______________________________________________<br />
swift-evolution mailing list<br />
swift-evolution@swift.org<br />
https://lists.swift.org/mailman/listinfo/swift-evolution<br /></blockquote>
</div>
</body>
</html>