Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Conversation

@supermarin
Copy link

OK
object.name = @"Github";
object.name;

NOT OK
object.doSomething;
object.copy;
AClass.makeSomeStuff;
AClass.alloc.init;
[AClass.alloc initWithName:@"Octocat"];

@alanjrogers
Copy link
Contributor

This appears to be less clear than our existing phrasing.

@supermarin
Copy link
Author

😸

@jspahrsummers
Copy link
Contributor

I agree with @alanjrogers. The point of our existing phrasing is that dot syntax is appropriate for any method which:

  1. Is repeatable with the same result
  2. Does not have side effects visible to the caller

This means we will happily use dot syntax for things other than @property declarations (e.g., NSFileManager.defaultManager), because it's about the semantics of the implementation, not the declaration in the header. And our guideline still rules out doSomething, copy, alloc, etc. methods.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

3 participants