The size of an empty Mac app

I created my first Macintosh application today, following Apple’s excellent docs. I didn’t write any code yet, just the default Cocoa application template. I’m always fascinated what the size of empty apps is; it often indicates how simple and clean the underlying architecture is.

I did “Build for Run” and stripped the binary. The compiled app is 44k. The binary is 14k, the NIB is 26k. It takes 10M of memory (80+M if you count shared).

Xcode created 13 files in my source directory: 14,000 lines of source totalling some 400k. Almost all of that is an XML bloated NIB file I’ll never look at as text. There’s 51 lines of ObjC code in 3 files. Pretty much all that is boilerplate; the important bits are

int main(int argc, char *argv[]) {
    return NSApplicationMain(argc, (const char **)argv);
}
@interface TrackMixAppDelegate : NSObject <NSApplicationDelegate> {
    NSWindow *window;
}
@property (assign) IBOutlet NSWindow *window;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    // Insert code here to initialize your application
}

It’s certainly nicer than the 400+ lines of unmaintainable garbage that Visual Studio’s wizard generates doing a similar task. I’m optimistic that the NIB system will work out well. MacApp’s version of this was a fucking disaster in the OS 6 days, but NextStep Interface Builder was always pretty impressive.