Functional Programming Principles

Richard Soriano
2 min readApr 1, 2022

How I increased my productivity through functional programming as a javascript developer

A new engineer facing bulky and confusing code

A nightmare scenario is when a new front end developer spends countless hours of his/her time trying to understand bulky code with paragraphs of comments. We all know the sinking feeling of combing through pages of documentation.

To prevent this, javascript developers should be encouraged and instructed on functional component principles. Functional programming is the principle of breaking down a complex behavior into small executable functions. These functions must perform simple tasks. That is considered best practices of javascript

Functional programming is also the style of great naming schemes. There should be a naming scheme that should be encouraged and taught early on. That way all the programmers are speaking the same language. Code names should be easy to read by everyone. The names should dictate what task the function performs such as sortByNumbers or sortByString. The names should be self-explanatory so that little to no documentation is required.

Break code up into small stateless functions. That way there is consistency in what is passed as arguments and the return values. Functions should be explicit rather than implicit. Pass the arguments, and return the values immediately. Values should be immutability. This creates stability. That way any new modifications will be isolated. This is especially true in Front End Engineering where stability is key and our job is state management.

Functional programming has elevated my programming skills. I now create small reusable code snippets. This may appear to be a slow process in the early stages. Overall, this has increased my efficiency and decreased debugging time. I am very fortunate to have studied under senior programmers who are always leveling up. It’s a win/win for all the developers on the team. Functional programming is an approach that I encourage other javascript engineers when it makes sense.

Leveling up through Functional Programming Principles

--

--

Richard Soriano

Passion for Web Developing. Specializing in Front-End such as React, Redux and expanding to the Back-End with NodeJS to MongoDB and GraphQL