NeoNacho - December 27, 2012
Why I don't use Interface Builder
An article is going around in the Apple developer circles these days. Many people seem happy that they finally can admit using IB. While it’s true that IB cannot be compared to WYSIWYG HTML tools or word processors, it still shares a lot of their problems:
Using IB does not mean you are using less code
You now have a lot less code written in Objective-C, true. Instead you have a huge pile of XML which is for all intents and purposes equivalent to that code. You have to maintain it and you have to fix it when it breaks. Every background-color you set and every autoresizing mask is just as prone to be wrong as if it was sitting in your .m file.
We have this thing called version control
The file format of IB is a mess. It is difficult to diff and nearly impossible to merge, which means you lose a lot of the benefits of using version control. You can no longer easily revert changes. If you are working in a team, you better make sure only one person edits that XIB at a time and if something breaks, you have no idea who did it or how to roll back just that one change. Storyboards make this problem several orders of magnitude worse.
Support different screen sizes
When laying out your UI in code, you can express the relation of views quite easily in ways which are simply not doable in IB. We have Auto Layout now, but that has its own issues. When making reusable components, it is important to think about more than just two or three sizes - what if you suddenly need this exact functionality in a popover? You are still pretty much doomed with your fixed layouts from IB.
So, this really does not have anything to do with snobbism against newbies. Interface Builder is a real world tool whose strengths lie in rapid prototyping and defining fixed layouts quickly, but you shouldn’t fool yourself into thinking you now have less code just because you hid it in your XML closet. All of it is still there and when your teammates break it, you will wish you had stuck with something you can actually understand.
Please sign in to post a comment.