
ReactiveCocoa for a better world - sant0sk1
https://github.com/blog/1107-reactivecocoa-for-a-better-world
======
notJim
For those not familiar, it looks like this is the take on ideas from Reactive
Extensions (Rx): <http://msdn.microsoft.com/en-us/data/gg577609>. I'm not sure
if Rx itself has a direct predecessor or not, but it's great to see the idea
taking hold in other communities. I've long suspected that there is a lot of
great stuff in the .Net world that most open-source-oriented programmers never
see, simply because they don't have exposure to Microsoft technology.

~~~
xpaulbettsx
Here's what Rx is: The idea of a list are some items in an order (a Sequence
in FP-speak). On top of a Sequence you can implement all kinds of interesting
operations like map/filter/reduce.

If you look at an Event like KeyUp, you'd end up with some items, in a
particular order. Thus, you realize, that events and lists really are the same
thing. In fact, they're not only ostensibly the same, they are mathematically
provable to be the same.

Rx therefore, gives you all the operations you can do to a list, and applies
it to an event (or a callback, which is just an event that only happens once).

~~~
scarmig
I enjoyed your book! Are there any plans for an updated or expanded version?

If anyone wants a simple introduction to Rx, Paul Betts (and Jesse Liberty)
wrote one last year.

[http://www.amazon.com/Programming-Reactive-Extensions-
Jesse-...](http://www.amazon.com/Programming-Reactive-Extensions-Jesse-
Liberty/dp/1430237473/ref=sr_1_1?ie=UTF8&qid=1336164661&sr=8-1)

~~~
xpaulbettsx
Thanks! No plans for a 2nd edition yet, but I definitely have a lot I'd like
to add.

------
eblume
This sounds neat, but I want to ask others here as I am not (yet) a Cocoa
developer - is all Cocoa code this ugly? In these short examples I honestly
can't fathom what is happening due to the syntactic 'oddities'. Maybe my
C-variant-fu is not as strong as it should be.

~~~
stcredzero
_This sounds neat, but I want to ask others here as I am not (yet) a Cocoa
developer - is all Cocoa code this ugly?_

I am a Cocoa developer, and I have to say that the presentation of this idea
on the blog leaves something to be desired. It seems to be oriented towards
people already familiar with Reactive Programming and FP, but it doesn't set
up that expectation at all. At the same time, it's very confusing and a little
unintentionally off-putting for devs who aren't familiar with those notions,
even for those who already know Objective-C and KVO.

It still might be a good idea, though.

~~~
joshaber
That was my fear while I was writing the post :\

The problem with Rx / RAC is there's a big learning curve, especially coming
from procedural programming. It's much bigger than 1 blog post can cover. My
hope at least is that it will drive at least some people to dive deeper.

------
swannodette
Awesome to see GitHub getting behind Rx ideas. If you're a JS developer RxJS
is definitely worthy of study:
[http://channel9.msdn.com/Blogs/Charles/Introducing-RxJS-
Reac...](http://channel9.msdn.com/Blogs/Charles/Introducing-RxJS-Reactive-
Extensions-for-JavaScript)

------
objclxt
I've just spent a few hours getting to know ReactiveCocoa better, and what a
great framework! Props to GitHub for open sourcing it, and I'm already looking
at how to integrate it into some of my apps. I blogged about my first
impressions here: <http://cleveryou.net/post/22447309056/rac-first-
impressions>

------
scarmig
Stuff like this makes me want to drop the WebForms work I'm doing for rent and
work on my FRP library... le sigh.

~~~
boothead
Which FRP library would that be?

~~~
scarmig
Unreleased =) The target language is JS (for now, at least), uses arrows and
features dynamic switching. Yampa is a major influence.

------
tablatom
For those unfamiliar with ObjectiveC syntax, this[1] is a very nice example,
in JavaScript, of how amazing this idea is.

[1] <https://github.com/Reactive-Extensions/rxjs-html>

------
boothead
This looks a lot like Functional Reactive Programming from the haskell
world... Anyone who knows care to comment on how similar they are?

------
gte910h
This makes me happy happy.

It will detangle some big apps I'm on.

