One or two years ago I read in the documentation that the best practice is writing a comment about a complexity of a computed variable or a constant if it is calculated more than a constant time. Nowadays, I can't find this comment in the docs. Can somebody help to me? Was it removed or I just wrong ( misunderstood something)?
You mean this, from the API Design Guidelines?
- Document the complexity of any computed property that is not O(1). People often assume that property access involves no significant computation, because they have stored properties as a mental model. Be sure to alert them when that assumption may be violated.
Yes! Thanks a lot!