Functional Programming is new to me and I have recently started learning F#. While it is not a 'pure' functional language, I feel that it is the middle ground between Functional and Imperative languages. Plus, since it is built to run on the CLR, you also have access to the rich collection classes the .NET framework has to offer.
As with everything else, functional programming has its own share of techno-babble. So as a start, I have decided to note the terms I have come across and the definitions/descriptions that go along with them.
var x = 10;, the type of
xis inferred to be an
In programming, a function or method is a block of code that performs a specific task and can have side effects, such as changing the state of an object.
Object Oriented Programming (OOP)
Int32, it may not do that actually.
For example, the function:
Int32 MyFunction(Int32 x)takes an integer and indicates that it returns an integer as well. However, it may throw an exception or do some side effects that you are not aware of it but there is no indication in the function definition of these additional effects.
First Class Function
Higher Order Function:
List.filterin F# is an operator that takes a function and a list and filters the input list based on the function passed to it. Operators are also an integral part of function composition.
For example, in F#:
let f g x = . . .is the same as saying, pass
xto the function,
f, and then take the result as pass it to
f g xis the same as