[swift-evolution] [Review] SE-0047 Defaulting non-Void functions so they warn on unused results
William Shipley
wjs at mac.com
Thu Mar 17 20:15:10 CDT 2016
Strong +1, with some nitpicks to enclosed example:
I disagree that NSNotificationCenter’s returned token should be ignored without warning—this goes against the patterns I’ve seen in programming Cocoa the last 27 years, where needing to unregistering for notifications when an object is unloaded is more common than registering once and leaving it for the lifetime of the app.
For instance, if you have an NSViewController, you would register for notifications in your ‘loadView()’ or ‘awakeFromNib()’ method, or possibly you’d register with your superview (or enclosing scrollView) in ‘viewDidMoveToSuperview(_)', and it’d be very poor form to not store the notification’s handle and unregister later when the view was removed / deallocated. There are very few objects in a program that are 100% persistent throughout the life of the app — sandbox apps with a single window may have some, but those are the exception.
• What is your evaluation of the proposal?
Yup.
• Is the problem being addressed significant enough to warrant a change to Swift?
Yup.
• Does this proposal fit well with the feel and direction of Swift?
Yup.
• If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
Nope.
• How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
Quick reading, but I’ve been programming for a while now and thought about the issue.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160317/706a0212/attachment.html>
More information about the swift-evolution
mailing list