Live data from Hacker News

What is the fuss with Reactive Cocoa?

khanlou.com

11–13 of 13 posts

Re: What is the fuss with Reactive Cocoa?

#11
post #9
post #2

I've been meaning to write something along those lines, thanks for stepping up! Virtually all the examples I've seen on the various sites/tutorials etc. seem to be more complicated, sometimes significantly, than their straightforward imperative counterparts. In addition, FRP is required to bring reactiveness to the stateless world of pure functional programming. OO, on the other hand, already is reactive. It's sort o…

It is only more complicated if you have no prior exposure to Functional or Reactive programming. Those of us who cut our teeth on Desktop GUI apps understand Reactive quite well. And combining Reactive with the most modern Functional paradigm is just icing on the cake. It means that building apps around event streams was the right model all those years ago, and that we really can use Functional style to tame those ev…

This is pretty much exactly what I am talking about:

Your premise is that "building apps around event streams was the right model". Well, I don't buy that premise. I am open to it as a conclusion, but I don't buy it as a premise.

The examples don't support your premise, because they do not demonstrate that anything got simpler, at least not in any obvious ways. It's not less code, and the code isn't simpler in obvious ways. Saying that I would need prior exposure to F(R)P programming also does not help, it reinforces the point that this is more complicated.

The analogy to "imperative looping" also does not help, Smalltalk has had fancy higher-order loop constructs since the 70ies and is not FP and does not require FRP or "event streams".

Please don't think I am not open to cool things like stream programming, I did my own FilterStreams back in the 90ies. My initial version of Higher Order Messaging also lifted sequential message sends into streams of filters.

I thought this was way cool when I came up with it, but a slightly more mature me realized that it was not nearly as useful as it was cool. To me, the FRP hype seems a lot like that: yes, I can see it's cool that you hook something up over here and then it just keeps going, but the seasoned programmer in me is wary and can't detect the useful as distinct from the cool.

And, just to repeat, I am open to seeing the useful, I just haven't seen it yet.

Finally, we've had constraint programming also since the late 70ies (and spreadsheets as a form of constraint programming is probably the most popular form of programming), and I don't see what FRP brings to the table relative to constraints, at least after you strip it of the FP baggage.

See ThingLab, 1978: http://en.wikipedia.org/wiki/ThingLab

Re: What is the fuss with Reactive Cocoa?

#12
post #8

You showed two Reactive examples. One was written with Reactive Cocoa, and one was written with the normal Cocoa reactive API. Simple examples like this are only the Reactivity 101 of Reactive Cocoa and do not fully showcase the power. Also, part of the power of using Reactive Cocoa on iPhone/iPad apps is that you can build them using the same Functional Reactive Programming style that you would use in Android, .NET,…

"You showed two Reactive examples. One was written with Reactive Cocoa, and one was written with the normal Cocoa reactive API."

Exactly. Cocoa already is reactive.

Post reply on HN