Get started with functional programming and F#

Working with functional programming requires a shift in your thinking, but has benefits in productivity for programmer and maintainer alike

Become An Insider

Sign up now and get FREE access to hundreds of Insider articles, guides, reviews, interviews, blogs, and other premium content. Learn more.

We all learned about mathematical functions when we studied algebra: y = f(x), where f(x) = ax2+…. In the abstract world of mathematics, functions are pure and reproducible and have no side effects.

In imperative programming languages such as C, functions (in the sense of subroutines that return a value) are often anything but pure, since they rely on internal and external state, and they may change their behavior from one invocation to another. While it's often useful and expedient to have functions with side effects, they can be complicated to debug and may present a nightmare for a maintainer.