Why Functional Programming?

Jigar Gosar
The Functional Programmer
2 min readJul 22, 2016

Let’s skip on what and focus on why Functional Programming

WHY FP?

After 15+ years of writing imperative and pseudo-functional code in Java, Ruby & Javascript. I stumbled upon an incredible Javascript library called Ramda.

In past 6–8 months I have been primarily working in Javascript. And after reading up on

  • The Philosophy of Ramda.
  • Hey Underscore, You’re Doing It Wrong!

I finally realized that I have been missing out on some of the fundamental principles of FP.

But this realization was not enough for me to start coding in this new found FP style. It took a significant part of past 6–8 months, for me to be able to grasp and use some of the intermediate level concepts. And even today I am struggling to understand some of the advanced concepts.

I did start small, using some of the functions from the Ramda library. Itching to use it more and more. Hacking and tinkering to figure out more ways in which particular function could be used.

Slowly a pattern began to emerge. I started noticing how small, concise, and modular the code was becoming. The code became much more expressive. And duplicate code appeared at places one would have never considered in an imperative style of coding.

So here is my hypothesis:

  • Functional Programming Style leads to smaller, modular, reliable code. Which in turn implies, that the code is more maintainable and easy to reason about.
  • And it is possible to write practical applications without having to learn about lambda calculus or category theory.

Don’t get me wrong; FP is not a silver bullet, but a fantastic tool. And like all tools, the onus in on the wielder.

Regardless, I have been more satisfied with the resulting code, than I have been in past 15 years.

On this publication, my objective is test the above hypothesis by building a full stack web application.

Stay tuned.

--

--