{"id":7608,"date":"2013-07-15T16:05:42","date_gmt":"2013-07-15T21:05:42","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=7608"},"modified":"2013-07-15T16:08:00","modified_gmt":"2013-07-15T21:08:00","slug":"effective-objective-c-2-0","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2013\/07\/15\/effective-objective-c-2-0\/","title":{"rendered":"Effective Objective C 2.0"},"content":{"rendered":"<p><a href=\"http:\/\/www.markbernstein.org\/Jul13\/EffectiveObjectiveC20.html\">Mark Bernstein<\/a> on Matt Galloway&rsquo;s <a href=\"http:\/\/www.amazon.com\/dp\/0321917014\/?tag=michaeltsai-20\">Effective Objective C 2.0<\/a>:<\/p>\n<blockquote cite=\"http:\/\/www.markbernstein.org\/Jul13\/EffectiveObjectiveC20.html\"><p>This book is organized and presented as an Objective C homage to Scott Meyers&rsquo; classic work, <i>Effective C++.<\/i> The new book is good and interesting and provides useful tips for working in Objective C, but it&rsquo;s far less interesting than Meyers.<\/p><\/blockquote>\n<p>I agree that there could be more discussion of key-value observing and concurrency. Also, Item 48 recommends block enumeration over <code>for<\/code> loops:<\/p>\n<blockquote cite=\"http:\/\/www.amazon.com\/dp\/0321917014\/?tag=michaeltsai-20\"><p>In the case of a dictionary, you get both the key and the value without any additional work, thereby saving the extra cycles required to obtain the value for a given key. Instead, the dictionary can give both at the same time, which is highly likely to be far more efficient, since keys and values will be stored together in a dictionary&rsquo;s internal data structures.<\/p><\/blockquote>\n<p>This makes intuitive sense, but I seem to recall reading that, in practice, a loop with fast enumeration is faster (perhaps due to function-call overhead).<\/p>","protected":false},"excerpt":{"rendered":"<p>Mark Bernstein on Matt Galloway&rsquo;s Effective Objective C 2.0: This book is organized and presented as an Objective C homage to Scott Meyers&rsquo; classic work, Effective C++. The new book is good and interesting and provides useful tips for working in Objective C, but it&rsquo;s far less interesting than Meyers. I agree that there could [&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":[168,63,54,71],"class_list":["post-7608","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-blocks","tag-book","tag-objective-c","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7608","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=7608"}],"version-history":[{"count":3,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7608\/revisions"}],"predecessor-version":[{"id":7611,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7608\/revisions\/7611"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=7608"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=7608"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=7608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}