Functional Programming

Alpha Shuro
Aug 4, 2017 · 2 min read

I didn’t like it, at first


When I initially learned functional programming I wondered why a library would be written, filled with jargon, and expected to become my method of problem solving. What justifies adding a library to do something I can already do with normal JavaScript? I found the answer to that question after I learned functional programming without JavaScript.

Functional programming is not a JavaScript specific concept. It’s a paradigm. A style. A mindset. It changes the way you approach problem solving, from trying to figure out how the computer should achieve the solution, to deciding what operations/transformations to apply to your data structure to achieve a final result. The benefit is that you are at a much smaller risk of running into errors because a description of the operations is easier for your brain to create abstractions from than a sequence of instructions. This makes it easier for your brain to reason about what the code is doing, and therefore you not only come to solutions faster but its easier for anyone reading your solution to understand it.

Prerequisites

  • English— you have to be willing to summon up a dictionary to look up the meaning of a word you don’t understand
  • Learning — there is a bit of jargon to learn in the beginning, but once you learn it you can reuse it across all functional programming libraries and languages.
  • Time — you will have to dedicate some time to reading a bit of documentation, to index the several functions you have available to you in Functional Programming libraries.
  • Understanding — know your JavaScript! it will be difficult to learn something new while trying to understand basic JavaScript, so if you are a beginner make sure that you know and understand JavaScript and what it offers before diving into functional programming.

Why it works

The brain processes ideas and thought by collecting a few pieces of information, forming an abstraction that represents this collection of information, and then moves on to the next collection, until it has a collection of abstractions, then it creates a new abstraction of these abstractions. This process happens as more information is imparted onto it, and this allows it to handle complex ideas without having to think about everything at the same time. That is what functional programming gives: abstractions. It allows one to abstract away the details of how the data is transformed, and simply describe the transformations instead.

Premise

Functional programming has given me:

  • Improved problem solving
  • Easier to read code
  • Reduced surface area for bugs

Alpha Shuro

Written by

programmer. human?

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade