Step 2: Apply Functional Programming Principles ~ Edward Garson

Birat Rai
2 min readSep 21, 2017

--

This is the second step towards gaining the Programming Enlightenment series. If you didn’t learn the first step, read it.

Functional programming treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data”

You have come across Functional Programming or Reactive Programming. And you never had the courage to undertake the functional journey, like so many developers who wants to withstand the change. The learning curve may be huge at the initial stage, but it will bear rewards for the persistence later.

What is functional programming?

  • It is a style of programming where you focus on transforming data through the use of small expressions that ideally don’t contain side effects.
  • Functional programming is about writing pure functions, about removing hidden inputs and outputs as far as we can, so that as much of our code as possible just describes a relationship between inputs and outputs

Why apply functional programming principles?

  • A leading cause of defects in imperative programing is mutable states or variables.
  • Functions in Functional programming always yield the same result given the same input, hence states aren’t of concern.
  • It greatly improves the quality of code, readability and understanding of developer.
  • It helps in debugging as smaller functions means smaller context which could result in erroneous mutable values.

TL;DR Master the Functional Programming Paradigm so that you are able to apply lessons learned to other domains.

Go to the series.

Go to the 3rd step in the series.

References:

--

--

Birat Rai
Birat Rai

No responses yet