Better code with functional programming
Eat Sleep Code Podcast - Podcast autorstwa Telerik
Kategorie:
On this episode of Eat Sleep Code, guest Dave Fancher talk about Functional Programming. We discuss how functional programming has made its way back into modern development, clean coding, and more. http://developer.telerik.com/content-types/podcast/better-code-with-functional-programming/ Ed Charbeneau** :** Hello and welcome to Eat Sleep Code, the official Telerik podcast. I'm your host, Ed Charbeneau, and with me today is Dave Fancher. Dave Fancher** :** Hello! EC: And today Dave and I will be talking about functional programming in .NET. Dave is author of, The book of F#, from No Starch Press and a Microsoft MVP for .NET and also the owner of Achiiv Solutions. Dave is a Pluralsight author, and he's done a course called, "Building F# Type Providers" and he's working on a new course about functional programming with C#. So Dave what is functional programming? DF: So ask ten different programmers what functional programming is, and you'll likely get ten different answers. But in general, they tend to boil down to three main characteristics. The first one is that functional programming is about controlling side effects, side effects are anything that changes the external state of the system. It could be as benign as writing to a log file, or it could be more nefarious like changing some shared data across the system. Under functional programming, we wanna control that as much as possible, also under functional programming, we tend to focus on expressions rather than statements, so C# tends to be statement-based. There are some expressions in there, but for the most part it's statement based, your if statements, your using statements, and so on, versus a functional language tends to be focused on expressions, rather than executing something for its effect we wanna execute something for its result. And then finally, functional programming is really centered on the idea of mathematical functions. And so functional languages want to treat functions as data. So you can pass around functions just as you would an integer or a string and that gives way to higher order functions, which is where most of the power of functional programming comes from. EC: So you're controlling the mutability of the data in the application. Find the full transcript on Telerik Developer Network http://developer.telerik.com/content-types/podcast/better-code-with-functional-programming/