Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can write Java code which works similarly to your C# code by using RxJava: https://github.com/Netflix/RxJava

Or Python, via RxPy: https://github.com/Reactive-Extensions/RxPy

Or JavaScript, via RxJs: https://github.com/Reactive-Extensions/RxJS

Or Ruby, via Rx.rb: https://github.com/Reactive-Extensions/Rx.rb

Or Objective-C, via Rx.ObjC: https://github.com/Reactive-Extensions/Rx.ObjC

Your code is a good demonstration of how Rx works though, and it's nice to know it's becoming more popular.



Rx was invented by Microsoft, so C# is a rightful first choice for Rx examples :). That code doesn't demonstrate Rx per se, it demonstrates how lambda expressions, extension methods, anonymous types, type inference enable a succinct backwards-compatible (to some extent) functional syntax in C#.


Look at the type signatures of many LINQ and Rx methods. I would hardly say they are succint. While just using expressions can be compact, maintaining a functional library or creating functional methods in your application will be a chore in c# due to the verbosity of the type syntax (Type inference won't help you on method signatures)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: