How to think functionally when using LINQ and Reactive Extensions
Written by Bjørn Einar Bjartnes
A survival guide to functional programming - an introduction
This series intends to teach programmers who come from an non-functional programming background, but who have to learn LINQ and/or Reactive Extensions, a few things that I spent quite a lot of time to learn. I think, in retrospect, that I could have grokked these concepts much quicker and with less pain if I had approached them differently. Of course, I do not know, I haven't tried. Learning is complex, I have to test it on people to figure out if the ideas work. Please, be my guinea pig.
The concepts behind LINQ and Reactive extensions are functional concepts, and are better understood in a functional paradigm, such as F#. This understanding is transerrable to C#. If you get hooked on F# and Functional Programming and want to stay with these concepts, I would not dissapointed. However, the goal of this little series is NOT to persuade anyone that F# is better than C#, but perhaps bring another perspective on LINQ and Reactive Extensions, to try to understand it from a different perspective.
Please, clear your mind, try to NOT connect any of these topics to existing things you already now yet. Try to not think of how this translates to anything you know from paradigms you already now.
Functions
It is hard to teach functional programming without functions. I will demonstrate LINQPad, which is what I use to code in for these demos and a few basic functions.
In this repository I have added some notebooks to play along with too https://github.com/bjartwolf/thinking_functionally_for_rx_and_linq
The intro episode to my series that is supposed to be a gentle guide to functional programming, indented to - in the end - make LINQ and Reactive Extensions easier to understand https://t.co/Yjdk6qUbB9 pic.twitter.com/b47fzSIjJe
— Bjørn Einar Bjartnes (@bjartnes) October 30, 2022