{"id":7006,"date":"2013-02-16T14:42:34","date_gmt":"2013-02-16T19:42:34","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=7006"},"modified":"2013-02-18T16:46:20","modified_gmt":"2013-02-18T21:46:20","slug":"reactivecocoa-explanation","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2013\/02\/16\/reactivecocoa-explanation\/","title":{"rendered":"ReactiveCocoa Explanation"},"content":{"rendered":"<p><a href=\"http:\/\/blog.maybeapps.com\/post\/42894317939\/input-and-output\">Josh Abernathy<\/a>:<\/p>\n<blockquote cite=\"http:\/\/blog.maybeapps.com\/post\/42894317939\/input-and-output\"><p>Because we treat all the inputs to our app as different things&mdash;a touch event here, a web response there&mdash;we can&rsquo;t combine them in any meaningful way. We can&rsquo;t transform them uniformly. And so our only tool for dealing with all these different things is state. When our only tool is state, every problem looks like a stateful nail.<\/p>\n<p>But happily this perspective of our app&rsquo;s output as a function of its inputs over time gives us a new tool: functional reactive programming. Functional reactive programming (FRP) is a paradigm built around the idea of time-varying values produced by time-varying functions.<\/p><\/blockquote>\n<p>He also has a basic example of what this looks like in Objective-C. I have not had a chance to look into <a href=\"https:\/\/github.com\/ReactiveCocoa\">ReactiveCocoa<\/a> deeply yet, but from what I&rsquo;ve seen so far it looks very exciting. It looks like what <a href=\"https:\/\/developer.apple.com\/library\/mac\/documentation\/Cocoa\/Conceptual\/CocoaBindings\/CocoaBindings.html\">Cocoa Bindings<\/a> should have been, designed to scale up from the easy cases to the harder ones, and taking full advantage of blocks.<\/p>\n<p>Update (2013-02-18): <a href=\"http:\/\/nshipster.com\/reactivecocoa\/\">Mattt Thompson<\/a>:<\/p>\n<blockquote cite=\"http:\/\/nshipster.com\/reactivecocoa\/\"><p>Bindings replace a lot of boilerplate glue code and allow programming to be done in Interface Builder, but they&rsquo;re severely limited and <em>impossible<\/em> to debug. RAC offers a clear, understandable, and extensible code-based API that works in iOS and is apt to replace all but the most trivial uses of bindings in your OS X application.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Josh Abernathy: Because we treat all the inputs to our app as different things&mdash;a touch event here, a web response there&mdash;we can&rsquo;t combine them in any meaningful way. We can&rsquo;t transform them uniformly. And so our only tool for dealing with all these different things is state. When our only tool is state, every problem [&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,69,199,71,341],"class_list":["post-7006","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-blocks","tag-cocoa","tag-bindings","tag-programming","tag-reactivecocoa"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7006","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=7006"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7006\/revisions"}],"predecessor-version":[{"id":7016,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7006\/revisions\/7016"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=7006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=7006"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=7006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}