From the course: Functional Programming with F# and C# by Microsoft Press

Unlock this course with a free trial

Join today to access over 23,400 courses taught by industry experts.

Data and functions

Data and functions

- [Instructor] Now, what we want to look at now is there's two ways we can write functional programs in our case for .NET. So we have the F# way. F# is functional first by default, just like C# is object-oriented by default. So this is F# code. We also have C# code over here. So you can see when you look at these together, they look very similar. I can actually put them side by side. You can see they're relatively the same lines of code. They have the same kind of style and layout. You'll notice the F# syntax doesn't have the curly brackets except for on the types here, but it's space, it's spaced eliminated. So it will know by the space before and after everything how to set it up. In C#, you don't really get that. Now, let's go ahead, since we've been looking at C# this whole time, we'll look at the C# example first. So, in C#, we have things called records. These are relatively new additions to the language.…

Contents