In C++ I was told that my classes shouldn't have getters and setters: Doing it wrong... blog post.On the other hand, in Objective-C, the direct use of ivar is discouraged, because the getters allow to do lazy instantiation, and setters make KVO easy.Why is that difference? 
C++ vs Objective-C design principles of setters and getters
c++;object oriented design;objective c
I think the best takeaway from the Doing it wrong... post is that exposing public accessors without a good reason breaks encapsulation by giving external classes the ability to modify and inspect state that ought not be made public. It's just expressed in an absolutist fashion (I'd argue if you have a Contact object, and want to put that contact's name on a label for an address book application, at some point Contact will probably have to expose its name to another object). Regardless, no matter what the language, making accessors available without thought is going to break encapsulation and lead to tight coupling.This is orthogonal to the best practice in Objective-C of using accessors for all (at least most) instance variable access. No where does Objective-C recommend making all your accessors publicly visible. Often you will have a class extension visible only to the class's own implementation that defines most of its instance variables and then the class's own implementation uses the accessors. And certainly, external code should always use the accessors - but they still should only be made visible to external code if absolutely necessary.