Tips to Conquer Massive View Controllers

View Controllers should only be responsible for view lifecycle events, Marcus Zarra reminds us. That means they should populate views with data, and show and hide them – stuff like that. View controllers should not do the work of views.

While I like his overall advice, it contains a few problematic points:

If we create an object to sit between the view and the view controller then we are creating unnecessary additional objects.

Where do presenters sit? Between view and and view controller – but they make it easier to read and extend the code. They're hardly unnecessary.

I strongly believe that it's impossible to give advice about how to code and architect something if the problem domain isn't part of the example. Because everything depends on the problem space in the end.

Remember to take every advice with a grain of salt. Collect things like Marcus' tips to obtain new tools, but don't take the tool for the solution of modelling a program to solve real problems.

Browse the blog archive