{"id":18233,"date":"2017-06-23T14:41:30","date_gmt":"2017-06-23T18:41:30","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=18233"},"modified":"2017-06-23T14:41:30","modified_gmt":"2017-06-23T18:41:30","slug":"refactoring-a-massive-view-controller","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2017\/06\/23\/refactoring-a-massive-view-controller\/","title":{"rendered":"Refactoring a Massive View Controller"},"content":{"rendered":"<p><a href=\"https:\/\/apontious.com\/2017\/06\/21\/refactoring-a-massive-view-controller\/\">Andrew Pontious<\/a>:<\/p>\n<blockquote cite=\"https:\/\/apontious.com\/2017\/06\/21\/refactoring-a-massive-view-controller\/\">\n<p>Even though I wasn&rsquo;t trying to finalize the design or the APIs yet, for each new area I pulled out, I found I could refine the previously-extracted areas. Exposed properties that before were accessed seemingly at random, I could now see were only used by one of the specific areas I&rsquo;d pulled out, and only at specific times. I could start to move properties around between the extracted classes, cut and paste them where they <em>should<\/em> go. I could move closer to the encapsulation I wanted.<\/p>\n<p>All without breaking anything, because I was taking such tiny, straightforward, <em>safe<\/em> steps.<\/p>\n<p>That meant, by the time everything was extracted, I was actually much closer to a final design than I had any right to be, given initial conditions.<\/p>\n<\/blockquote>\n<p>I have found this to be true as well. <\/p>","protected":false},"excerpt":{"rendered":"<p>Andrew Pontious: Even though I wasn&rsquo;t trying to finalize the design or the APIs yet, for each new area I pulled out, I found I could refine the previously-extracted areas. Exposed properties that before were accessed seemingly at random, I could now see were only used by one of the specific areas I&rsquo;d pulled out, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[27,71,816],"class_list":["post-18233","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-craft","tag-programming","tag-refactoring"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/18233","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=18233"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/18233\/revisions"}],"predecessor-version":[{"id":18234,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/18233\/revisions\/18234"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=18233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=18233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=18233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}