Skip to content

Commit 9b67c6b

Browse files
committed
stdilb: Document the new policy about complexity and properties vs. methods
Swift SVN r28498
1 parent 86dc008 commit 9b67c6b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/StdlibAPIGuidelines.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,10 @@ library, but are compatible with the Cocoa guidelines.
124124

125125
* We document the complexity of operations using big-O notation.
126126

127-
* Properties are O(1) to read and write.
127+
* In API design, when deciding between a nullary function and a property for a
128+
specific operation, arguments based on performance characteristics and
129+
complexity of operations are not considered. Reading and writing properties
130+
can have any complexity.
128131

129132
* We prefer methods and properties to free functions. Free functions
130133
are used when there's no obvious `self` ::

0 commit comments

Comments
 (0)