Functional programming for beginners

Happy New Year everyone; I hope you had a pleasant and relaxing festive holiday season. I sure did.

I’m starting the new year off by giving a short — an hour long or so — talk on how you can use ideas from functional programming languages in C#. It will broadcast this coming Wednesday, the 13th of January, at 10AM Pacific, 1PM Eastern.

The talk will be aimed straight at beginners who have some experience with OOP style in C# but no experience with functional languages. I’ll cover ways to avoid mutating variables and data structures, passing functions as data, how LINQ is functional, and some speculation on future features for C# 7.

There may also be funny pictures downloaded from the internet.

Probably it will be too basic for the majority of readers of this blog, but perhaps you have a friend or colleague interested in this topic.

Thanks once again to the nice people at InformIT who are sponsoring this talk. You can get all the details at their page:

In related news, I am putting together what will be a very, very long indeed series of blog articles on functional programming, but not in C#. Comme c’est bizarre!

Foreshadowing: your sign of a quality blog. I’ll start posting… soon.

12 thoughts on “Functional programming for beginners

  1. This is actually a fantastic topic and I’m glad you’re planning on covering it.

    As it is targeted at those with at least a little OOP experience but fresh to the topic of functional programming, one thing I hope that you touch on is the WHY you would reach for Functional Programming as a tool in your programming toolbox. I’ve never quite understood just what problem it is that Functional Programming addresses that conventional OOP cannot address (at least not in any way that I can put into words).

    • I agree completely. I use a lot of LINQ and sometimes immutable objects, but I barely ever pass functions, as refactoring always leads me to pass interfaces instead. I still havent really figured out when you’d use functional programming and in particular no-one ever talks about when NOT to use it. What types of problems are more suited to the functional style, and what types are more suited to OOP?

    • Thanks! I will talk about the “why” a little bit, but basically it boils down to (1) a great many bugs are caused by bad mutations. By taking a page from functional style and designing programs so that variables and data structures change as little as possible, we can eliminate a large source of bugs. (2) Structuring programs into small functions whose outputs each depend solely on inputs makes for programs that are easy to unit test. And (3) the ability to pass functions as data allows us to create new and interesting control flows and patterns, like LINQ.

  2. Exciting!!
    I had the chance to experience with ML, and a tiny bit of Haskell during my undergraduate studies, it was so very elegant… [And yes, some of it was mimicable by LINQ]
    Sooo… is it one of those? maybe F#? nahhh, too obvious…
    I have to try a multi-language solution with both C# and F# libraries…

    Looking forward to it.

  3. Pingback: The Morning Brew - Chris Alcock » The Morning Brew #2007

  4. Pingback: Szumma #024 – 2016 2. hét | d/fuel

  5. Hey Eric!
    Any news about the recording of the session?
    on the page they said it’ll be available in about 2 weeks after the event, and I am reaaaalllly looking forward to it.

    I hope you’re having fun at the new job, the Z-Machine series is awesome 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s