Why initialize the menubar without Interface Builder
Why initialize the menubar without Interface Builder
- Subject: Why initialize the menubar without Interface Builder
- From: Erik Buck <email@hidden>
- Date: Sat, 3 Nov 2007 12:39:38 -0700 (PDT)
There is a current discussion "Re: Initializing the menubar without Interface Builder." What I desperatly want to know is WHY ?
Jeff Johnson has kindly provided a series of articles about HOW to do it, but not WHY at http://lapcatsoftware.com/blog/2007/07/10/working-without-a-nib-part-5-open-recent-menu/
The closest Jeff gets to telling us WHY is "There are a number of reasons why you might want to build your application without a nib. As you may know, nib is an acronym for no inspecting bindings. Anyone who uses version control ... can see in the diffs that nib files are rather opaque."
I am sympathetic to the argument that development should not depend on opaque data files. Wait a minute: .o files are opaque, frameworks and static libraries are opaque, most xml files are opaque or at least incomprehensible.
There is a very nice tool that opens nib files and shows you their contents. Why single out .nib files as the one non-source-code development resource that isn't allowed to be opaque ?
Steve Jobs once famously personally told me (OK - told everyone in the auditorium) the following in approximately 1989: "Every line of code is a potential bug and has a long term maintenance cost. It doesn't matter if the line of code is machine generated or manually generated. The initial cost to write a line is typically small compared to the lifetime cost to maintain it, and machine generated code is not magically bug free. The only way to reduce the cost of software is to produce more features with fewer lines of code."
If there is an opportunity to use a data file instead of code, choose the data file every time. Interface Builder exists to produce data files that replace tens of thousands of lines of code. One of the reasons that other "Interface Building Tools" frequently suck is that the generate code instead of data files. You end up with lots of yucky code to maintain forever.
It seems perverse to me that anyone would invest any effort to hard code user interfaces.
Having said all that, Interface Builder is not perfect or magic. I usually prefer an easily human readable text file to a binary file. I like plist files. I would like a tool that could output a nice table that summarizes all of the bindings in a nib file. But I like any data file better than the equivalent lines of code.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden