Hi list,

being the Objective-C noob I am (having understood the technical side 
but still getting to know a lot of best-practices) I stumbled upon the 
use of forward-declarations in header-files today. Basically what it 
does is this:

#include "PBGitTree.h"

@interface PBGitHistoryController : PBViewController {
[...]                                                                   
        PBGitTree* gitTree;
[...]

At that point in a header, the compiler doesn't need to know much about 
PBGitTree, other than that it's a class. So instead of the #include-line 
we could use:
@class PBGitTree;
and put the #include into the .m (implementation).

Why this should be done is described here: 
http://vgable.com/blog/2008/12/04/cocoa-coding-style-minutia-all-forward-declarations-on-one-line-is-the-one-true-way/
 
under ("What is @class good for?")

If someone gave me some kind of green light I'd begin the laborious task 
of rewriting all the files, and then do a test of the resulting 
re-compile times. If someone has any technical objections to this 
practice let me know as well.

Greetings,
Jojo

-- 
Johannes Gilger <[email protected]>
http://heipei.net
GPG-Key: 0x42F6DE81
GPG-Fingerprint: BB49 F967 775E BB52 3A81  882C 58EE B178 42F6 DE81

Reply via email to