[swift-evolution] Pitch: Progress Tracking in Swift

Brent Royal-Gordon brent at architechies.com
Mon Jan 18 23:35:50 CST 2016


> What do you all think?

I think this is really thin syntactic sugar over `-> NSProgress`, and doesn't add enough value to justify itself. Unlike the error handling system:

- The fact that a function *can* provide progress doesn't mean that any particular caller needs that progress.
- Progress monitoring doesn't require a lot of convoluted control flow.
- There is no need to customize the progress monitoring system in the way that, for instance, `ErrorType` allows.
- Progress monitoring doesn't require convoluted ways of returning the progress, since most progress-reporting operations are asynchronous and have no other immediate return value.
- Progress monitoring is actually done fairly infrequently.

I think that all Swift needs to support progress monitoring is to make sure that `NSProgress` returns can be ignored without a warning even if we make `@warn_unused_return` the default, and perhaps to overload `+=` on two `NSProgress`es if we can find an appropriate way to do it.

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list