Falling in love with Rx (again)

Last week I was involved in preparing some Proof-of-Concept for Comet (http://en.wikipedia.org/wiki/Comet_%28programming%29) implementation using asynchronous controllers in ASP.NET MVC 3. Hopefully this technical opening didn’t scare you off ;) In brief, simple words - we needed a solution that was able to push events (notifications) asynchronously from the server side to the client’s browser in as efficient manner as possible (used threads, opened connections, repeated calls, etc.). You can call it a foundation for a real-time system accessible via the browser. I’ve used Reactive Extensions (Rx) to deal with the server side (pub-sub, filtering, aggregation) and I was once again simply amazed how powerful this framework is: proper usage of Observer design pattern with asynchronous computing enables so many options.
And then, by accident, I’ve found out something more - Rx is available for JavaScript as well (named Rx-Js)! What for? Doesn’t JavaScript already have event subsystem - oh yes it has and here comes Rx-Js to make it much more usable (pretty much like standard Rx improved working with events in C#).
And here’s wiki with some examples: http://rxjs.wikidot.com/start
Blow against the trend
Krzysztof Koźmic was brave enough to question the overwhelming trend of introducing Dependency Injection (http://en.wikipedia.org/wiki/Dependency_injection) everywhere and everytime in his blog post (http://kozmic.pl/2012/09/05/to-constructor-or-to-property-dependency/). It seems that even if he won’t achieve his goal, he’ll get a lot of attention as the discussions have already started in the community. Personally I disagree with him, because of two reasons:
* DI is very complementary with TDD and "interface up-front" approach
* Loose coupling and ability to substitute components transparently (including mocking) are priceless (statement based on own experience)
New book about C#
I had an opportunity to check an interesting new book about C# that was published recently - "C# Smorgasbord" by Filip Ekberg (http://www.amazon.com/C-Smorgasbord-ebook/dp/B008X8SIU0). Is there a need for another book about C#? Don’t we have too many already on our shelves? Actually this book is quite interesting. Usually books that describe some particular programming language just go through the syntax, some basic libraries (I/O, threading, connectivity, etc.) - all of that to give you tools to work with. But does this knowledge make you a competent programmer already? Well, not really - these are just the most basic tools and you need learn more about:
  • common pitfalls in the language
  • typical problems and situations to avoid
  • recommended patterns
And "C# Smorgasbord" is a book of such type. It’s a book you should read when you’re done with learning “ifs”, “fors” and “whiles”. It’s not a deep dive yet, but it will show you that it takes much more to be a good programmer than to be able to transform block diagrams into algorithms.
Share this post