<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><div style="direction: inherit;"><div style="direction: inherit;"><span style="background-color: rgba(255, 255, 255, 0);">It's probably too late by now, but I've always enjoyed C#'s naming convention of having interfaces (C# protocols) names start with capitale I:</span></div><div style="direction: inherit;"><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div style="direction: inherit;"><span style="background-color: rgba(255, 255, 255, 0);">IEquatable, IComparable</span></div><div style="direction: inherit;"><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div style="direction: inherit;"><span style="background-color: rgba(255, 255, 255, 0);">You get used to it and it's a nice way of avoiding name clashes between classes and protocols, which we currently handle in Swift by suffixing Protocol.</span></div></div></div><div><br>On 22 Jul 2016, at 15:14, Vladimir.S via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><div><span>I remember that this was discussed, but can't find any decision regarding this.. So, as a last chance, don't we want in Swift 3.0, as big source breaking change, separate class inheritance and protocol conformance in syntax?</span><br><span></span><br><span>Sorry if there was a decision about this suggestions. Please let know in this case.</span><br><span></span><br><span>I.e. when I see the following I can't understand if the class inherits from base class and conforms to protocols or just conforms to two protocols:</span><br><span></span><br><span>class MyClass : First, Second, Third {</span><br><span>}</span><br><span></span><br><span>We don't have a rule to name protocols with 'Protocol'/other suffix/prefix, or classes with 'T'/'C' prefix or something like this, so I believe to improve the clarity of code we should separate in syntax inheritance and conformance.</span><br><span></span><br><span>As I understand we should discuss changes in these areas:</span><br><span></span><br><span>1. class inheritance :</span><br><span>class Child: BaseClass</span><br><span></span><br><span>2. class conformance :</span><br><span>class Child: SomeProtocol1, SomeProtocol2</span><br><span></span><br><span>3. class inheritance + conformance :</span><br><span>class Child: BaseClass, SomeProtocol1, SomeProtocol2</span><br><span></span><br><span>4. protocol conformance for structs:</span><br><span>struct Struct: SomeProtocol1, SomeProtocol2</span><br><span></span><br><span>5. protocol inheritance:</span><br><span>protocol Child: BaseProtocol1, BaseProtocol2</span><br><span></span><br><span></span><br><span>My suggestions:</span><br><span></span><br><span>I) separate inheritance with double colon :</span><br><span></span><br><span>1. class inheritance :</span><br><span>class Child:: BaseClass</span><br><span></span><br><span>2. class conformance :</span><br><span>class Child: SomeProtocol1, SomeProtocol2</span><br><span></span><br><span>3. class inheritance + conformance :</span><br><span>class Child:: BaseClass : SomeProtocol1, SomeProtocol2</span><br><span></span><br><span>4. protocol conformance for structs:</span><br><span>struct Struct: SomeProtocol1, SomeProtocol2</span><br><span></span><br><span>5. protocol inheritance:</span><br><span>protocol Child:: BaseProtocol1, BaseProtocol2</span><br><span></span><br><span></span><br><span>II) in class definition use parenthesis to separate inheritance and conformance :</span><br><span></span><br><span>1. class inheritance :</span><br><span>class Child: BaseClass</span><br><span></span><br><span>2. class conformance :</span><br><span>class Child: (SomeProtocol1, SomeProtocol2)</span><br><span></span><br><span>3. class inheritance + conformance :</span><br><span>class Child: BaseClass (SomeProtocol1, SomeProtocol2)</span><br><span></span><br><span>4. protocol conformance for structs:</span><br><span>struct Struct: SomeProtocol1, SomeProtocol2</span><br><span>or</span><br><span>struct Struct: (SomeProtocol1, SomeProtocol2)</span><br><span>should be discussed</span><br><span></span><br><span>5. protocol inheritance:</span><br><span>protocol Child: BaseProtocol1, BaseProtocol2</span><br><span></span><br><span></span><br><span>III) special word like 'conforms'</span><br><span></span><br><span>1. class inheritance :</span><br><span>class Child: BaseClass</span><br><span></span><br><span>2. class conformance :</span><br><span>class Child: conforms SomeProtocol1, SomeProtocol2</span><br><span>or</span><br><span>class Child conforms SomeProtocol1, SomeProtocol2</span><br><span></span><br><span>3. class inheritance + conformance :</span><br><span>class Child: BaseClass conforms SomeProtocol1, SomeProtocol2</span><br><span></span><br><span>4. protocol conformance for structs:</span><br><span>struct Struct: conforms SomeProtocol1, SomeProtocol2</span><br><span>or</span><br><span>struct Struct conforms SomeProtocol1, SomeProtocol2</span><br><span></span><br><span>5. protocol inheritance:</span><br><span>protocol Child: BaseProtocol1, BaseProtocol2</span><br><span></span><br><span></span><br><span>Thoughts?</span><br><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>