Say no to Storyboards

Tsai Zhenling
2 min readFeb 8, 2016

--

Because it’s not worth it. On first look it’s nice as it gives you a good overview of what the application does. Don’t adopt storyboards if this is the only reason. It will not make a difference to a developer working on the code base full-time. If your new hire needs a storyboard to figure out how to navigate the code base, he/she is not competent enough to do this professionally.

Please consider the following before deciding to commit to using storyboards.

In a large team, merge conflicts are a bitch. Yes, even if 2 developers are editing different viewcontrollers, if done at the same time, chances are, you’ll get merge conflicts.

Secondly, you can’t be selective about the features you want to use for each viewcontroller. Either you use autolayout for the whole storyboard, or you do not. I like to be selective because I want to keep things as simple as possible. Some views are simple enough that you can express all layout requirements using just autoresizing. Why complicate things? (rhetorical question)

Furthermore, Segues suck. The use of segues enforces the presence of bad practices. Let’s look at an example of passing data from one viewcontroller to another.

Notice the use of magic strings to identify the segue. We pass data through assignment to a public property, which means the property must be mutable, even when it is unnecessary. It makes code more robust to enforce a proper state of an object at initialisation. This is typically done using your own initialiser, which cannot be used with segues.

It’s a nice concept to be able to create an app by just clicking and dragging. But in most cases, we need more than that. If you do end up using storyboards, I implore you to stay away from segues.

Lastly, it’s also easy for a storyboard to get too large to work with. For an e-commerce application I am working on, it takes a good 3 seconds to open the file. If a developer does not have enough RAM on the machine, opening the file may even crash Xcode. I can only imagine these poor developers saying a silent prayer to their respective gods before opening the .storyboard file.

Take destiny into you own hands. Say no to storyboards.

--

--