<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"><style type="text/css">body { background: rgba(255, 255, 255, 255); }</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I think requiring them to be in comments is what’s going to prevent their adoption.<div class=""><br class=""></div><div class="">My fundamental stance is that these awesome features that are required in comments will be overlooked by people because:</div><div class="">• You have to remember the specific syntax&nbsp;</div><div class="">• There is no code completion which means you have to know the *exact* syntax and spelling</div><div class=""><br class=""></div><div class="">At the end of the day, Swift is a new language, and because of this, is there a new and better way to convey information than just sticking everything in a comment?</div><div class=""><br class=""></div><div class="">With autocomplete we could get something like this:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font color="#bb2ca2" style="font-family: Menlo; font-size: 12px;" class="">extension </font><font color="#008cb4" class=""><font face="Menlo" class=""><span style="font-size: 12px;" class=""><b class="">Type,</b> named <b class="">Name</b> </span></font></font><font face="Menlo" class=""><span style="font-size: 12px;" class="">{</span></font></span></div></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">}</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">This would make it much easier for people to adopt than requiring them to remember a comment syntax.</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">However, if there is no interest, I will not proceed with a proposal.</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">Just my .02</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">Brandon</span></div><div style="margin: 0px; font-size: 12px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><font color="#008cb4" class=""><br class=""></font></span></div><div class="">Where autocomplete would let you tab between naming the Type and Name</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 16, 2016, at 3:24 PM, Erica Sadun &lt;<a href="mailto:erica@ericasadun.com" class="">erica@ericasadun.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Most of the Swift docs markup tech is both very new and still evolving. I'm trying to evangelize the technology, and there are now five markup items that actually tie into the code completion engine:</div><div class=""><br class=""></div><div class=""><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px; color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class=""><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">Three new doc comment fields, namely&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">- keyword:</code>,&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">- recommended:</code>&nbsp;and&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">- recommendedover:</code>, allow Swift users to cooperate with code completion engine to deliver more effective code completion results. The&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">- keyword:</code>&nbsp;field specifies concepts that are not fully manifested in declaration names.&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">- recommended:</code>&nbsp;indicates other declarations are preferred to the one decorated; to the contrary,&nbsp;<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">- recommendedover:</code>&nbsp;indicates the decorated declaration is preferred to those declarations whose names are specified.</p></li></ul><div class="">-- E</div></div><div class=""><br class=""></div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On May 16, 2016, at 1:14 PM, Brandon Knope &lt;<a href="mailto:bknope@me.com" class="">bknope@me.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">I have never seen anyone use this. Why? Because it is relatively unknown and not very “pretty” in my opinion. In the ideal world, everyone would have perfectly formatted and up to date comment, but I am not convinced this is usually the case.<br class=""><br class="">It’s good for IDE documenting, but:<br class="">• Online tutorials do NOT use this in code samples, keeping it from being widely known (and because it looks ugly next to their sample and makes it look more verbose)<br class="">• It really does not look nice with the language. It seems like IDE magic<br class="">• What about people writing in a text editor or not in Xcode? If they do not get a benefit out of // MARK: or /// - Keyword: why would they use it?<br class=""><br class="">And a quick read of Matthew’s proposal tells me that it may be beneficial to be able to refer to the name of an extension in the future. I am still reading through his proposal but that’s what I took from it with a quick look.<br class=""><br class=""><br class="">Brandon<br class=""><br class=""><blockquote type="cite" class="">On May 16, 2016, at 3:08 PM, Erica Sadun &lt;<a href="mailto:erica@ericasadun.com" class="">erica@ericasadun.com</a>&gt; wrote:<br class=""><br class="">Or better yet, the 'Keyword" token offers searchable content that can relate one extension to the other.<br class=""><br class="">/// - Keyword: Lifecycle extension<br class=""><br class="">-- Erica<br class=""><br class=""><br class=""><blockquote type="cite" class="">On May 16, 2016, at 11:33 AM, Michael Peternell via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class="">Why not just use a (documentation) comment?<br class=""><br class="">/// The Lifecycle extension:<br class="">extension ViewController {<br class="">...<br class=""><br class="">-Michael<br class=""><br class=""><blockquote type="cite" class="">Am 16.05.2016 um 18:26 schrieb Brandon Knope via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt;:<br class=""><br class="">I like to separate methods into their own logical extensions so similar methods are grouped together. I do this mostly with Cocoa Touch where I like all view life cycle methods to be in the same extension:<br class=""><br class="">extension ViewController {<br class=""> &nbsp;override func viewDidLoad() {<br class=""> &nbsp;}<br class=""><br class=""> &nbsp;override func viewWillAppear(animated: Bool) {<br class=""> &nbsp;}<br class=""><br class=""> &nbsp;override func viewDidDisappear(animated: Bool) {<br class=""> &nbsp;}<br class="">}<br class=""><br class="">You can document this somewhat by adding a MARK comment:<br class=""><br class="">// MARK: Lifecylce<br class="">extension ViewController {<br class=""> &nbsp;override func viewDidLoad() {<br class=""> &nbsp;}<br class=""><br class=""> &nbsp;override func viewWillAppear(animated: Bool) {<br class=""> &nbsp;}<br class=""><br class=""> &nbsp;override func viewDidDisappear(animated: Bool) {<br class=""> &nbsp;}<br class="">}<br class=""><br class="">What if we made this more self-documenting by elevating this to a language feature?<br class=""><br class="">extension ViewController named Lifecycle {<br class=""> &nbsp;override func viewDidLoad() {<br class=""> &nbsp;}<br class=""><br class=""> &nbsp;override func viewWillAppear(animated: Bool) {<br class=""> &nbsp;}<br class=""><br class=""> &nbsp;override func viewDidDisappear(animated: Bool) {<br class=""> &nbsp;}<br class="">}<br class=""><br class="">Other ways:<br class="">extension named Lifecycle ViewController { }<br class="">extension named “View Lifecycle" ViewController { }<br class="">extension ViewController named “Multi word description” { }<br class=""><br class=""><br class="">For now, this is purely a documenting feature (i.e. Can’t refer to the extension name dynamically or statically in actual code). I think it plays much more naturally with Swift than requiring this to be in the comments and would work across all IDEs and make it easier for people to find a specific extension as well as making their code more self documenting.<br class=""><br class="">Any thoughts?<br class=""><br class="">Thanks,<br class="">Brandon<br class=""><br class=""><br class=""><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></blockquote><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></blockquote><br class=""></blockquote><br class=""></div></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div></body></html>