Great talk. Missing the Zoran Horvat courses on pluralsight in your 'Further reading' section.
@madsimonj3 жыл бұрын
I'm afraid I don't have a pluralsight subscription. Please feel free to share the link, though.
@MartinHAndersen2 жыл бұрын
The nino validation returns true or false. How could it return and explanation on why it failed?
@pino67823 жыл бұрын
Just in case people have not noticed yet, .Net has also native, functional-first programming language called F#.
@madsimonj3 жыл бұрын
It absolutely does. I've never learned it myself, but I'd be happy to if I were in a team that was up for it. Sadly I still think we're a long way away from mainstream support for F#, so there's nothing wrong with trying to make use of those same principles in C# itself.
@ProgrammingMadeEZ4 жыл бұрын
Pattern matching in C# 8 is much improved since this video was released.
@madsimonj3 жыл бұрын
Very true. I'd also strongly recommend looking at the new Record types in C#9. They're one of the best functional features in a while
@drunkonmonads3 жыл бұрын
I have used language extensions which encapsulates the ideas mentioned here so no need to write own version. Great talk.
@madsimonj3 жыл бұрын
I agree. No need, but its a good learning exercise & I think the syntax can be cleaner sometimes when you roll your own compared to LanguageExt
@smritidutta16313 жыл бұрын
Codes are not fully visible ,which hinders my understanding.
@simonpainter22422 жыл бұрын
Apologies for that. I've done this same talk for a number of other venues. The code is probably easier to read on some of those. If you check out the NDC Conferences channel, you'll find an updated version of this I did for NDC Porto earlier this year
@eonduplessis114 жыл бұрын
I found this workshop handy. Although, I code in Typescript now. I have done .NET / C# for 8 years. Maybe I can find some use for this in the game development space. There is a UI/User interaction, but I suppose that's where I'd do plain old OO, and where we process gamedata and models, rather use Pure functions where possible.
@chesterapavliashvili15334 жыл бұрын
I am trying to apply functional C# in unity engine too
@SamuelLugoBueno4 жыл бұрын
Can You please share the slides? This is super handy! Thanks for the useful video!
@madsimonj4 жыл бұрын
Thanks! I've just popped a link to the slides up
@hirisraharjo3 жыл бұрын
@@madsimonj I have a question, until now I thought I've been doing FP in javascript but I guess I'm not. Sometimes I'm still using some ifs inside my function (probably just to check if the input is null) and then you said that there are no if statement in FP. So how does the real FP handle the if condition? using ternary operator? (I saw that in your slides) and if it does use ternary, doesn't it just the same? Btw, superb presentation!
@madsimonj3 жыл бұрын
@@hirisraharjo the ternary expression is an operator, not a statement, so its fine. Its a quick way of performing somd logic, but without the messy tendencies of true If statements. Also- thanks. I'll try and make more when I have time
@ghostg61072 жыл бұрын
Great talk!
@simonpainter22422 жыл бұрын
Thanks :)
@mikepike20004 жыл бұрын
I'm sorry, I think I have looked everywhere for the link to the slides?? Anyone see it?
@mikepike20004 жыл бұрын
Found it.. he left off the h so it didn't appear to be a link: www.dropbox.com/s/wfcug5871erbfzc/Functional%20C-Sharp%20-%202020-01.pptx?dl=0
@dotnetsheff4 жыл бұрын
Thanks Micheal, We'll stick it in the description too!
@tarktaro38613 жыл бұрын
Awesome
@simonpainter22422 жыл бұрын
Thanks :)
@DoorThief3 жыл бұрын
Woaaah
@simonpainter22422 жыл бұрын
That's a good "Wooah", I'm hoping!
@madsimonj4 жыл бұрын
Also, for anyone interested, my website & blog are here: www.thecodepainter.co.uk
@tsooooooo3 жыл бұрын
Good intro but can't agree that FP is bad for UI programming!
@simonpainter22422 жыл бұрын
it's not that it's bad, per se. It's more that you have to make some sort of compromise at that point.
@emilorefors62772 жыл бұрын
As far as i know there's no difference between linq select and map
@simonpainter22422 жыл бұрын
There is. Select operates exclusively on Enumerables (and derivatives) an element at a time, so 'x' for a Select statement is an individual item in an array of some kind. Map operates on _any_ object and on the whole object, so you could call Map on a string, or an integer. If you called Map on an Enumerable, then 'x' would be the entire enumerable, not just a single element of it.
@emilorefors62772 жыл бұрын
@@simonpainter2242 but what would be the practical difference when running it on a collection?
@simonpainter22422 жыл бұрын
@@emilorefors6277 if you passes an arrow function with a parameter 'x' to a Select statement on at Enumerable, then the type of x is T. If you called Map on that same Enumerable, then x would have the type Enumerable. I.e. map operates on the whole original object, not just individual elements within it
@emilorefors62772 жыл бұрын
@Simon Painter im pretty sure this is not how it works. For example, map in javascript and also in f#, will both have x being the type of T
@simonpainter22422 жыл бұрын
@@emilorefors6277 you're right, but we have Select in C# that performs the same role as Map in JS. I _could_ have called it Bind too, but I thought that Map was a friendlier name
@chrisbaker52842 жыл бұрын
I would have watched more of this but many of the slides are cut off at the bottom, which is very annoying. The first 10 minutes talk about how wonderful functional programming is, the implication it is better then OO, which is not true. Both paradigms have their advantages and disadvantages. I'm a programmer of more than 20 years and I am always happy to learn and try new things, but forcing an OO language to use functional paradigms is a bit like using a spanish guitar to play heavy metal - it's just plain wrong. If you want to do functionla programming use a functional programming language! Functional programming does not hold state and is stateless? And becasue of that it is great at data processing. But as it is stateless what data does it process? Immutablity is where you get better thread safety and while that concept may have originated from the mathematical functional world it's not a functional programming feature, you can create immutable classes in c# (and I have been for years), that doesn't make it functional.
@undeadspez3 жыл бұрын
When is Functional Programming *not*: UI React: I beg to differ
@Qrzychu923 жыл бұрын
Elm: B**** please :P
@simonpainter22422 жыл бұрын
It's not that Functional can't do UI, it's more that compromises have to be made at that point. You can't write an applicaiton entirely of side-effect free pure functions and still have external interactions.
@joandimko30635 жыл бұрын
some code samples are cut and not readable :-( and you are talking about readability :-)
@madsimonj4 жыл бұрын
Which ones? I can pass you a copy of the slides, if you like?
@dotnetsheff4 жыл бұрын
That's our fault, not the speakers, HDMI recording seemed to have been cropped 😢 sorry about that.
@madsimonj4 жыл бұрын
I've added a link to the slides now
@ayoubihbibibi24044 жыл бұрын
why are you like that ? we have free and great explanation on functional programming , and you are still not happy ...you could have stopped with the first line of your comment. Please reboot or format/ reinstall your mindset ...you will make life very hard for you and people around you otherwise :(
@drunkonmonads3 жыл бұрын
I have used language extensions which encapsulates the ideas mentioned here so no need to write own version. Great talk.
@drunkonmonads3 жыл бұрын
While not covered in video I actually saw just now that the slides talk of language extensions as well.
@simonpainter22422 жыл бұрын
Yeah, LangExt is out there & seems fine. I'm not necessarily advocating everyone to go out and write your own implementation of this, but I think it's important to know how you *might* do it, to help with understanding.