Functional Programming in C#

Sign in to queue

Description

In this episode, Robert is joined by Ed Charbeneau for a discussion of how a number of language features in C# support functional programming, a programming style that treats computation as the evaluation of mathematical functions and avoids changing state and mutable data. 

Resources:

Embed

Download

The Discussion

  • User profile image
    Randy Pena

    Nice video, very interesting content. I will start to implement this clear and clean way of code. Thanks guys as always you upload very very good videos.

  • User profile image
    EdCharbeneau

    @Randy Pena: Thanks for the feedback. I'm glad you found the video useful. :D

  • User profile image
    BrianCatlin

    According to Wiktionary, the pronunciation of 'tuple' can be either 'tupple' or 'toople'; however, the English pronunciation rules specify the 'u' would be a long 'u' (and thus be pronounced as 'toople') because of the single following consonant.

  • User profile image
    Saeb Panahifar

    @EdCharbeneau: Thank you. It was so useful.

  • User profile image
    Sonny

    Great Video. Thank you for posting. I will be learning more about functional programming in the future.

  • User profile image
    Roodborst​Kalf

    Interesting examples, especially the ones at the end concerning the cardgame. Some of these ideas  can also be used in evaluating boardgames like chess or draugts. 

  • User profile image
    Easy

    Really good video. Very well explained.

  • User profile image
    Anton

    Great video! I just want to point out that there seems to be a miscommunication at around 16:00 wherein the Ternary Operator(?:) was misunderstood as the Null Conditional operator ("Elvis operator", "?."). Some viewers might find that bit confusing because of the misunderstanding.

  • User profile image
    eleanorburn​er

    Very useful video! Thank you

  • User profile image
    EdCharbeneau

    @Anton: Thanks for the feedback. I give this talk a lot at conference and workshops. I'll make sure to clear that up in future presentations.

  • User profile image
    ershadnozari

    Wow brilliant stuff!

  • User profile image
    Erik

    @Anton Good point, I wanted to say the same thing

  • User profile image
    DaanAcohen
  • User profile image
    tgrt

    Since we're talking about pronunciations... It's "ternary" (turn-a-ree) not "tenary" (ten-a-ree). I believe Robert mentioned it being added to the language at version 6. However, it's been with C# since the beginning.

  • User profile image
    EdCharbeneau

    @all thanks so much for the feedback.

    @tgrt: Yes! :S I have corrected my self many times but keep managing to get it wrong. It's one of those things you internalize often but don't say aloud very much. Thanks you for commenting and watching. :)

  • User profile image
    dougcobie

    Excellent show!  I'm surprised how well C# lends itself to functional style programming.

    Personally, I think the use of the well formated nested conditional operator was simpler and more readable than than taking the first from the list of tuples.

     

  • User profile image
    Jeroen

    Very nice and informative video. As you said, cleaner code leads to less chance to mess up! Cool stuff in here.

  • User profile image
    EdCharbeneau
    • @dougcobie: I totally get why you would have that preference. If you don't need the flexibility of a sorted list then I would definitely choose the more legible option. 
  • User profile image
    ladyquarter​maine

    Loving the stickers!

  • User profile image
    alizad

    @EdCharbeneau A little side question, what font are you using inside visual studio?

  • User profile image
    josetjack

    That is sick (in a good way)!

  • User profile image
    natanp

    Nice talk!

    More intuitive and simpler way for getting max value out of sequence:

    cards.Max(c => c.Value)

    Cheers!

  • User profile image
    EdCharbeneau

    @EdCharbeneau A little side question, what font are you using inside visual studio?

    @alizad https://github.com/tonsky/FiraCode

    Nice talk!

    More intuitive and simpler way for getting max value out of sequence:

    cards.Max(c => c.Value)

    Cheers!

    @natanp actually .Max(c => c.Value) returns an int and I wanted an object. For Max to work on an object you need a custom comparer.

  • User profile image
    natanp

    Oops... Correct!

  • User profile image
    alizad

    @EdCharbeneau:Thank you so much! I recently switched to fira mono, and this looked awfully familiar. Also, I really appreciate that you are actively reading the feedback and comments. 

  • User profile image
    EdCharbeneau

    @alizad: likewise, I appreciate all of the excitement and feedback from everyone.

    + 1 Fira Code [H]

  • User profile image
    Martin

    Great video!
    Just wanted to add. Using the function expressions would also make a function less prone to breaking Open Close Principle.

  • User profile image
    EdCharbeneau

    Great video!
    Just wanted to add. Using the function expressions would also make a function less prone to breaking Open Close Principle.

     

    Nice tip. I'll have to add that to fact to my workshop.

  • User profile image
    Rejeesh S

    Very useful video.
    It is presented in a very simple way. Sample codes are also easy to understand.
    Nice one ! Thank you!

  • User profile image
    DexterZ


    Good watch and good timing ^ _ ^ y

    Sample from this vids is very useful for Game development and Database project to write simple and clean code using LINQ along with Lambda expression and excessive used of "?:" operator.

    Very Nice!

Add Your 2 Cents