[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Property syntax and readability (was Re: Strange crash in __objc_res
From: |
Ivan Vučica |
Subject: |
Re: Property syntax and readability (was Re: Strange crash in __objc_resolve_class_links) |
Date: |
Wed, 16 Feb 2011 20:02:43 +0100 |
I mostly agree with Jason :-)
On 16. vel. 2011., at 16:52, Jason Felice wrote:
> Actually, just declaring properties seems bunk. This is an implementation
> detail which should be encapsulated, no?
I don't mind declaring properties, but I mind having to use @synthesize,
despite understanding why it's necessary :-)
> The other thing is that declarations of interfaces, protocols, and
> implementations in Objective-C very much look like statements rather than
> beginnings-of-constructs and ends-of-constructs. In C and C++, I can scan a
> header file and go, "there's two classes in there, and they interact thusly".
> In Objective-C it just seems like an amorphous blob of @foo directives and
> method declarations and I often miss that there's more than one object in a
> header. Is this just my brain? Xcode's and Vim's syntax highlighting?
I found it a good practice to avoid putting multiple classes in a single file
in C++, too. In ObjC, that's even easier, and I do it as rarely as possible.
> I mean, I've been thinking of writing _comments_ (*gasp*) in order to have
> something break up the monotony so that you can pick out distinct objects
> visually.
#pragma mark -
#pragma mark something?
alternatively:
// MARK: -
// MARK: something?
I use that all the time to organize myself in Xcode. :-)
--
Have fun,
Ivan Vučica
ivan@vucica.net - http://ivan.vucica.net/
smime.p7s
Description: S/MIME cryptographic signature