[swift-evolution] API Guideline bugs and enhancements
Erica Sadun
erica at ericasadun.com
Tue Jan 5 14:44:24 CST 2016
Are API Design Guideline improvement discussions in scope for the Swift Evolution list and if not, where would they go?
For example, the current Swift API Design Guidelines follow these rules more or less.
Use imperative verb phrases for mutating methods: x.reverse(), x.sort(), x.tweak()
Use noun phrases for non-mutating methods: x.distanceTo(...), idx.successor()
Seems to me the rules should actually be along the lines of:
Use verb phrases to declare procedural methods, whether or not they mutate an instance or just produce side effects: x.reverse(), x.sort(), x.tweak(), x.perform(), x.dispatch(), x.send()
Use noun phrases to describe values returned by a functional method: x.distanceTo(y), index.successor() (This admittedly leaves further issues around other functional methods, for example, seq.separatedBySequence(seq) and int.strideTo(other: Self, step:Self.Stride), etc. )
Are enhancements for API Design Guidelines an area for community involvement? Where would you start a discussion about the rules? Would modifications involve formal proposals?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160105/68ab9ed2/attachment.html>
More information about the swift-evolution
mailing list