Functional programming is all about data and the functions we use to transform that data.
Data retains the shape of data rather than objects (data + accessors + mutators) and functions remain separate from data.
Never change the data itself. Create a new structure with new data.
Benefits:
Functions take inputs, return outputs, and ideally do nothing else (that is, have no side effects).
This makes reading code much easier: you can abstract away functional complexity and think at the grain of the problem.
The opposite: an accessor ("get" property) which modifies data, or a Get procedure which updates tables.
Functions are values like integers or strings. You can take a function as an input to a function and a function can return a function as an output.
Functions are an abstraction for performing operations on data. This approach leads to composition: layering functions together rather than implementing parent and child objects through inheritance.
Relevant functional programming concepts:
Reasons to learn about functional programming include:
Reasons to learn about functional programming include:
Data science:
Big Data:
Key concepts:
Database developers have a leg up on thinking functionally:
Functional programming still helps people who work in C# and Java all day.
We have seen more and more functional programming concepts make their way into these languages, especially C#. LINQ, lambda expressions, async and Task<>, Func<>, non-nullable object types, record types, and more have made their way into C# (at least as of C# 8).
We will now look at an F# console application filled with basic examples of what you can do with the language.
This isn't always the best code and it's not a perfect guide for learning the language, but it gives you a feel for behavior and a few of the language benefits.
Functional programming has its own mindset which can take time getting used to, especially if your background is as an object-oriented developer. There are significant benefits to building up your FP skills, especially if you are interested in the Data Engineering space, where languages like Scala dominate.
To learn more, go here:
https://csmore.info/on/fp
And for help, contact me:
feasel@catallaxyservices.com | @feaselkl
Catallaxy Services consulting:
https://CSmore.info/on/contact