Events in C# 4.0


Rx : Reactive Extensions for .Net and JavaScript.

Rx is a set of framework extensions to allow developers to easily do asynchronous programming via familiar interfaces. If you are familiar with LINQ and IEnumerable<T> and IEnumerator<T> you will instantly be able to grasp and use the new interfaces IObservable<T> and IObserver<T>. The enumerating interfaces allow you to PULL sequences of T from an interface in your code. The observing interfaces allow you to have sequences of T PUSHED to handlers in your code in response to asynchronous LINQ queries. Rx is implemented over the top of PFx (Parallel Framework extensions) so all the threading and concurrency is handled for you including synchronization contexts which is especially useful if you are programming UI. It is also particularly significant that the Rx extension methods include a FromEvent() method that allows you to attach handlers to a steam of events in a very fluid way.

If you want to know more watch the video on the bottom of this page where Rx author Erik Meijer explains it in 14 minutes.

If you want to see it in action have a look at this Channel9 video with Wes Dyer where he implements drag & drop from scratch using Rx in 6 minutes.

Also, checkout the Rx Team Blog for downloads, updates and samples.

Finally, back to Channel9 to look at RxJS for Reactive extensions for Java Script so the UI I mentioned above now includes web UI too. As Jeffrey Van Gogh says in the RxJS video, web programming is about “asynchronous stuff” but java script is an imperative language. It’s really hard to do good asynchronous stuff in java script. RxJS changes that it a big way.

Building from the ground up

I recently carpet-bombed my main work laptop and built it from scratch. Not something I do very often but the time had come. Here’s what went back into the box (the box being my trusty Dell D830) :

OS : Windows 7 Ultimate 64-bit

Productivity Stuff :

Development Stuff :

System Management Stuff :

Utils & Misc :

Observations :

  1. Wow ! That’s a lot of stuff. Now I remember why I don’t do that very often.
  2. Development stuff still outweighs everything else by far.
  3. Why do I still have an optical drive on this laptop? During all of the above I never once used a CD or DVD.
  4. When I started developing I used TextPad and a compiler and I hated IDEs. I still occasionally use TextPad but now I have two versions of Visual Studio with a zillion plug-ins. My daughter once asked me “What’s that game you play where all the words pop-up and change colour.” It took me a while to work out she meant Visual Studio 🙂
  5. I really only installed Snippet Compiler for old time’s sake as development seems to have stopped. I use LINQPad for that stuff now.
  6. Outlook 2010 is amazing.
  7. Visio 2010 drives me nuts because I have LIVED in previous versions of Visio way too long and now everything has moved. It’s like my house has been burgled by Feng Shui experts with OCD. I’m learning to live with it though 🙂
  8. When the hell is LiveMesh going to get out of Beta ?
  9. My beloved Paint Shop Pro disappeared up its own arse around the time it was acquired by Corel (coincidence ?) and since then I have stubbornly stuck to version 6 which is next to useless on Windows 7. Paint.Net is a worthy and FREE replacement. Nice one guys.
  10. I want to love SketchFlow, but I also want to beat it’s stupid head in with a brick.
  11. Reflector is still way cool and it now has a “PRO” version for £125 – OUCH ! Guess how many new cool features the free version will be getting from now on 😉
  12. Loving LINQPad. It has more or less replaced Snippet Compiler, SQL Management Studio and a bunch of other little utilities on my machine. Take the LINQPad Challenge today.
  13. Nearly half my development stuff is now for mobile. Scary 😮
  14. Previous problems with Security Essentials have not manifested themselves. Hmmm….
%d bloggers like this: